$npx -y skills add DevExpress/agent-skills --skill devexpress-office-file-api-excel-exportBuild .NET applications with the DevExpress Excel Export Library for streaming generation of Excel files with low memory footprint. Use when generating large Excel reports, writing rows sequentially, building Excel files from data grids or report engines, or when the full Spreads
| 1 | # DevExpress Excel Export Library |
| 2 | |
| 3 | The Excel Export Library is a low-level, streaming .NET API for generating Excel files (.xlsx, .xls, .csv) with a minimal memory footprint. It writes rows sequentially to an output stream and cannot read or modify existing files. Use it when you need to produce large Excel reports from databases or data grids without loading the entire document into RAM. The primary namespace is `DevExpress.Export.Xl`. |
| 4 | |
| 5 | ## CRITICAL: Excel Export Library vs. Spreadsheet Document API |
| 6 | |
| 7 | | | Excel Export Library | Spreadsheet Document API | |
| 8 | |---|---|---| |
| 9 | | **Model** | Streaming — write rows top-to-bottom, forward only | In-memory — random access to any cell at any time | |
| 10 | | **Memory** | Very low — ideal for large files | Higher — entire workbook in RAM | |
| 11 | | **Can read files?** | No | Yes | |
| 12 | | **Can modify existing files?** | No | Yes | |
| 13 | | **Charts, Pivot Tables?** | No | Yes | |
| 14 | | **NuGet** | `DevExpress.Document.Processor` (shared) | `DevExpress.Document.Processor` | |
| 15 | | **Namespace** | `DevExpress.Export.Xl` | `DevExpress.Spreadsheet` | |
| 16 | |
| 17 | **Rule**: If the developer needs to read, modify, add charts, or create pivot tables → use the Spreadsheet Document API skill instead. If they need to stream-generate a large file from data → this skill is correct. |
| 18 | |
| 19 | ## When to Use This Skill |
| 20 | |
| 21 | Use this skill when you need to: |
| 22 | |
| 23 | - Generate large Excel reports (.xlsx) with low memory consumption |
| 24 | - Write rows sequentially from a database reader or IEnumerable data source |
| 25 | - Export grid or report engine data to Excel in a streaming fashion |
| 26 | - Create Excel files in server-side or cloud environments where RAM is constrained |
| 27 | - Apply cell formatting (fonts, colors, borders, number formats) during export |
| 28 | - Add formulas, subtotals, or AutoFilter to generated files |
| 29 | - Create conditional formatting rules on streamed data |
| 30 | - Build Excel tables (IXlTable) with styles and calculated columns |
| 31 | - Insert sparklines or pictures into generated worksheets |
| 32 | - Configure print settings, headers/footers, and page breaks |
| 33 | - Add data validation rules to cell ranges |
| 34 | |
| 35 | ## Prerequisites & Installation |
| 36 | |
| 37 | ### NuGet Packages |
| 38 | |
| 39 | | Package | Purpose | |
| 40 | |---------|---------| |
| 41 | | `DevExpress.Document.Processor` | Excel Export Library (streaming API) | |
| 42 | |
| 43 | String formulas (parsed from text) require an additional reference — see [references/getting-started.md](references/getting-started.md). |
| 44 | |
| 45 | ### .NET (8/9/10+) |
| 46 | |
| 47 | ```bash |
| 48 | dotnet add package DevExpress.Document.Processor |
| 49 | ``` |
| 50 | |
| 51 | ### .NET Framework (4.6.2+) |
| 52 | |
| 53 | Add assembly references manually — see [references/getting-started-dotnet-fw.md](references/getting-started-dotnet-fw.md). |
| 54 | |
| 55 | **Important**: All DevExpress packages in a project must share the same version number. A valid DevExpress license is required. |
| 56 | |
| 57 | ### Package Versions |
| 58 | |
| 59 | Unless the user explicitly requests a specific version, always target the latest DevExpress release (v26.1 at the time of writing). `dotnet add package <PackageName>` without `--version` installs the latest stable version — prefer this form. Never pin an older version in project files, Dockerfiles, or CI/CD pipelines unless the user asks for it. This is especially important in integration scenarios (Docker, cloud deployments). All `DevExpress.*` packages in a project must share the same version. |
| 60 | |
| 61 | ## Before You Start — Ask the Developer |
| 62 | |
| 63 | If the host agent has a structured question-asking tool available, use it to ask these questions one at a time with clear options — for example, Claude Code's `AskUserQuestion` tool or GitHub Copilot's `askQuestions` tool. If no such tool is available, ask the questions directly in the chat response before generating code. |
| 64 | |
| 65 | Before generating code, ask these questions to avoid rework: |
| 66 | |
| 67 | ### General Questions |
| 68 | 1. **Target framework**: Are you using .NET 8+ or .NET Framework 4.x? |
| 69 | 2. **New or existing project?**: Are you creating a new project or adding to an existing one? |
| 70 | 3. **Hosting model**: Console app, ASP.NET Core, Blazor, MAUI, WinForms, WPF, or something else? |
| 71 | |
| 72 | ### Excel Export-Specific Questions |
| 73 | 4. **Scenario check**: Are you generating a new large report (this library is correct) or do you need to read/modify an existing file (use Spreadsheet Document API instead)? |
| 74 | 5. **Data source**: IEnumerable / DataTable |