DocumentFormat.OpenXml
Official Open XML SDK for direct manipulation of Office Open XML document structures.
Decision Guide
Office automation on servers should avoid desktop interop and rely on document libraries. The main decision is balancing API ergonomics, file-format fidelity, and commercial licensing obligations for production workloads.
The decision to make
Which library should a .NET application use to read or generate Office documents?
Curated starting points to compare. Always evaluate suitability against your specific project requirements.
Official Open XML SDK for direct manipulation of Office Open XML document structures.
Developer-friendly API over Open XML focused on Excel workbook generation and editing.
Comprehensive Excel library with advanced spreadsheet features and mature API surface.
Choose the narrowest supported document format and create a reusable template or document builder per report type. Keep business data preparation separate from workbook or document formatting.
Process documents as server-side files; never automate the desktop Office applications in a web service. Bound input sizes and use temporary storage with predictable cleanup.
Validate generated files with the target consumer workflow, including formulas, print layout, accessibility requirements, and Excel/Word version compatibility where applicable.
Risk
Checklist
Re-evaluate Office package decisions when licensing posture changes, report complexity grows, or document fidelity requirements tighten.