DevExpress Excel Spreadsheet API
The DevExpress Spreadsheet Document API is a cross-platform .NET library that allows you to create, load, modify, save, and print Microsoft® Excel® workbooks in code. With this library, you can work with worksheets, formulas, charts, pivot tables, data validation, protection, and export to PDF or HTML.
Get Started
Install the DevExpress.Document.Processor NuGet package
dotnet add package DevExpress.Document.ProcessorCode Example - Calculate Formulas and Export a Workbook to PDF
using DevExpress.Spreadsheet;
using var workbook = new Workbook();
workbook.LoadDocument("spreadsheetFile.xlsx");
workbook.Calculate();
MemoryStream pdfStream = new MemoryStream();
workbook.ExportToPdf(pdfStream);Code Example - Create a Workbook from Scratch
using DevExpress.Spreadsheet;
using var workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
workbook.BeginUpdate();
worksheet.Cells["A1"].Value = "*";
for (int i = 1; i < 11; i++)
{
worksheet.Columns["A"][i].Value = i;
worksheet.Rows["1"][i].Value = i;
}
worksheet.Range["B2:K11"].Formula = "=B$1*$A2";
workbook.EndUpdate();
workbook.Calculate();
workbook.SaveDocument("TestDoc.xlsx", DocumentFormat.Xlsx);File Format Support
- Import/Export: XLSX, XLS, XLSB, XLSM, XLT, XLTX, XLTM, XML, CSV, TXT
- Export Only: PDF, HTML, Image Formats (BMP, PNG, JPEG, EMF, WMF, SVG)
Key Features
The DevExpress Spreadsheet Document API allows you to manage Excel files in code:
- Generate or edit spreadsheet content
- Analyze and visualize data with tables, pivot tables, and charts
- Add and calculate cell formulas
- Sort, filter, validate, and apply conditional formatting to worksheet data
- Password-protect and encrypt documents
- Digitally sign spreadsheets
- Print and export worksheets
- And much more