Cross-Platform Support

Designed for C# and VB.NET — Runs on .NET 10, 9, 8, .NET Framework 4.6.2+.

DevExpress Spreadsheet Document API – Quick Start

Set up DevExpress Spreadsheet API on your machine and build Excel spreadsheet and
data analysis workflows in your next great DevExpress-powered .NET application.

Windows-based Installer

Run our Unified Installer (includes all DevExpress components and libraries) to start your free 30-day trial.

Free 30-Day Trial

NuGet

Install the DevExpress.Document.Processor NuGet package to start your free 30-day trial. Copy the installation command and add the package to your project using NuGet CLI.

dotnet add package DevExpress.Document.ProcessorCopy

Required Namespace and Class

Namespace:

Class:

DevExpress.Spreadsheet

Workbook

Quick Start Code

  • C#
using DevExpress.Spreadsheet;
using (FileStream fs = File.OpenRead("document.xlsx")) {
    Workbook workbook = new Workbook();
    workbook.LoadDocument(fs);
    workbook.ExportToPdf(new FileStream("exported-doc.pdf", FileMode.Create));
}
Copy

Supported Spreadsheet Elements

Use the DevExpress Spreadsheet API to use and modify the following Excel document elements.

Workbook

Worksheets

Rows/Columns/Cells

Tables

Pivot Tables

Formulas

Defined Names

Charts

Sparklines

Shapes & Text Boxes

Pictures

Hyperlinks

Comments & Notes

Form Controls

Headers & Footers

Frozen Panes

Custom XML Parts

OLE Objects

Document Properties

Generate & Modify Excel Files

Create, modify, and organize Excel workbooks programmatically. Generate dynamic reports, merge data, and
manage worksheets with full control over structure, content, and layout.

Create and Modify Workbooks

Create new workbooks programmatically or modify existing Excel files. Update cell values, calculate formulas, apply formatting, and insert analytics/visualization elements such as pivot tables and charts.

Documentation

Organize Worksheets

Add, remove, rename, reorder, hide, or protect worksheets. Extract cell ranges or entire sheets into separate documents while preserving data and formatting.

Documentation | Demo

Manage Rows and Columns

Insert, delete, resize, and hide rows and columns. Apply automatic layout adjustment based on content size to ensure clean and well-structured worksheets.

Documentation

Read/Write Cell Values

Access and modify text, numbers, dates, Booleans, formulas, and in-cell images. Apply number formats to ensure accurate easy data readability.

Documentation

Merge and Copy Excel Data

Combine multiple Excel files into a single workbook or distribute data across files. Copy worksheets or cell ranges while preserving formatting, styles, formulas, and structure.

Documentation | Demo

Page Setup

Configure paper size, margins, orientation, headers, footers, and print titles. Define print areas, manage page breaks, and adjust scaling to produce print-ready documents.

Documentation

Adjust View Settings

Control zoom, gridlines, headings, and frozen panes to optimize worksheets for on-screen presentation.

Documentation

Modify Document Properties

Read and update document metadata such as title, author, subject, keywords, and custom properties to improve classification and searchability.

Documentation

  • C#
using DevExpress.Spreadsheet;
using System.Drawing;

// Generate Excel report from scratch
using var workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Name = "Sales Report";

// Set cell values and apply formatting.
worksheet["A1"].Value = "Product";
worksheet["B1"].Value = "Revenue";
worksheet["A2"].Value = "Widget A";
worksheet["B2"].Value = 15000;
worksheet["A3"].Value = "Widget B";
worksheet["B3"].Value = 23000;
worksheet["B2:B3"].NumberFormat = "$#,##0.00";

// Create a table from the data range
Table table = worksheet.Tables.Add(worksheet["A1:B3"], true);
table.Style = workbook.TableStyles[BuiltInTableStyleId.TableStyleLight9];
table.ShowTotals = true;

// Save in different Excel formats
using var xlsxStream = new MemoryStream();
workbook.SaveDocument(xlsxStream, DocumentFormat.Xlsx);
Copy

Formula Calculation Engine

Initiate advanced data calculations with our high-performance, Excel-compatible formula engine.
Leverage 400+ built-in functions across mathematical, statistical, financial, and lookup categories.

Excel-Compatible Formula Engine

Create and evaluate formulas of various types: simple, array, shared, and dynamic array. Use Excel-compatible formula syntax in cells, pivot tables, and conditional formatting rules.

Documentation

Formula Parsing & Evaluation

Parse, analyze, and evaluate complex expressions step-by-step. Control calculation modes and inspect intermediate results to understand and optimize spreadsheet logic.

Documentation

Formula References

Use A1 and R1C1 reference styles. Address cells using defined names, absolute, mixed, relative, and 3D references. Access cell data from other worksheets or external workbooks.

Documentation

Multi-threaded Calculations

Accelerate formula evaluation with multi-threaded processing. Efficiently handle complex calculation chains in high-load or server-side scenarios.

Documentation

Custom Functions

Extend the calculation engine with custom functions (UDF) to support specialized business logic and advanced calculation scenarios.

Documentation

Trace Cell Dependencies

Track precedent and dependent cells to analyze the calculation flow and ensure accurate updates when source data changes.

Circular Reference Detection

Detect and handle circular references in formulas to prevent calculation errors and maintain data integrity.

  • C#
using DevExpress.Spreadsheet;

using var workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Name = "Sales Report";

// Import sales data and create a table with calculated columns
worksheet.Import(new object[,] {
        { "Sales Rep", "Revenue", "Target", "Comission" },
        { "Alice", 54200, 50000, 0 },
        { "Bob", 38750, 45000, 0 },
        { "Carol", 61300, 55000, 0 }
    }, 0, 0);
Table table = worksheet.Tables.Add(worksheet.GetDataRange(), true);
table.Columns[3].Formula = "=IF([Revenue]>=[Target], [Revenue]*0.08, [Revenue]*0.05)";

// Add summary formulas below the table
worksheet["A7"].Value = "Total Revenue";
worksheet["B7"].Formula = "=SUM(B2:B5)";
worksheet["A8"].Value = "Average Revenue";
worksheet["B8"].Formula = "=AVERAGE(B2:B5)";
worksheet["A9"].Value = "Top Performer";
worksheet["B9"].Formula = "=MAX(B2:B5)";

worksheet["B:D"].NumberFormat = "$#,##0.00";
worksheet["A:D"].AutoFitColumns();

// Evaluate all formulas and save the workbook
workbook.Calculate();
using var outputStream = new MemoryStream();
workbook.SaveDocument(outputStream, DocumentFormat.Xlsx);
Copy

Data Manipulation & Analysis

Extract, analyze, visualize, and transform spreadsheet data with our powerful data search,
filtering, sorting, grouping, and validation tools.

Search and Replace Text

Locate and replace text or values across worksheets using flexible search criteria, including case sensitivity, partial matches, and scoped ranges.

Documentation

Group Data

Group rows and columns to organize large datasets. Collapse and expand grouped data to improve readability and navigation.

Documentation

Sort and Filter Data

Sort and filter data by values, colors, or custom criteria. Apply auto-filters and advanced filters to cell ranges and tables to focus on relevant information.

Documentation

Apply Data Validation Rules

Enforce data integrity with validation rules such as lists, ranges, and custom conditions to control user input and prevent errors.

Documentation

Create Tables

Convert cell ranges into structured tables with built-in sorting, filtering, and styling. Enable structured references for easier formula management.

Documentation

Manage Pivot Tables

Create, modify, and refresh pivot tables to summarize and analyze large datasets. Configure data layout, grouping, sorting, filtering, and calculated fields.

Documentation

Leave Comments & Notes

Add, edit, and manage threaded comments and legacy notes to annotate data, collaborate, and provide contextual information within spreadsheets.

Documentation

  • C#
using DevExpress.Spreadsheet;
using DevExpress.Spreadsheet.Charts;

using var workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Name = "Dashboard";

// Import data for chart & pivot table
worksheet.Import(new object[,] {
        { "Region", "Q1 Sales", "Q2 Sales" },
        { "North", 4500, 5200 },
        { "South", 3200, 3800 },
        { "East", 5100, 4700 },
        { "West", 2800, 3100 }
    }, 0, 0);
CellRange dataRange = worksheet.GetDataRange();

// Create a pivot table 
Worksheet pvtSheet = workbook.Worksheets.Add("Pivot");
var pivotTable = pvtSheet.PivotTables.Add(dataRange, pvtSheet["A1"]);
pivotTable.RowFields.Add(pivotTable.Fields["Region"]);
pivotTable.DataFields.Add(pivotTable.Fields["Q1 Sales"], "Sum of Q1");
pivotTable.DataFields.Add(pivotTable.Fields["Q2 Sales"], "Sum of Q2");
pivotTable.Style = workbook.TableStyles[BuiltInPivotStyleId.PivotStyleMedium9];

using var outputStream = new MemoryStream();
workbook.SaveDocument(outputStream, DocumentFormat.Xlsx);
Copy

File Conversion & Export

Convert, export, and print Excel documents with high fidelity. Transform spreadsheets into PDF, HTML, and image formats while preserving layout, formatting, and accessibility. Our cross-platform export implementation ensures consistent results across Windows, macOS, and Linux environments.

Convert to Excel Formats

Convert spreadsheets between various Excel formats (XLS, XLSX, XLSM, XLSB, XLTX, CSV, and more) while maintaining content structure, formulas, layout, and formatting.

Documentation | Demo

Export to PDF

Convert Excel files to PDF with high fidelity. Preserve layout, fonts, and visual elements to ensure consistent output across platforms. Define document properties, security settings, and attach files.

Documentation | Demo

Export to Accessible & Compliant PDFs

Export documents to PDF/UA-compliant files with proper tagging to support screen readers. Generate PDF/A-compliant documents for long-term archiving.

Documentation | Demo

Export to HTML

Export Excel worksheets to HTML for seamless integration with web applications and workflows.

Documentation | Demo

Export to Image Formats

Convert worksheets, cell ranges, and charts to raster and vector images (PNG, JPEG, BMP, SVG, and more) for previews, thumbnails, or integration in other documents and systems.

Documentation | Demo

Print Excel Files

Print documents programmatically on Windows, Linux, and macOS with full control over page settings and output.

Documentation

Export Formatted Cell Content

Extract formatted cell content (rich text) as an HTML or RTF string for further analysis and integration.

Documentation

Asynchronous Document Processing

Load, save, and export documents asynchronously to improve performance in server and cloud environments.

  • C#
using DevExpress.Spreadsheet;
using DevExpress.XtraPrinting;

using var workbook = new Workbook();
using var inputStream = new MemoryStream(File.ReadAllBytes("Template.xlsx"));
workbook.LoadDocument(inputStream, DocumentFormat.Xlsx);
workbook.Calculate();
Worksheet worksheet = workbook.Worksheets[0];

// Export to PDF with options
PdfExportOptions pdfOptions = new PdfExportOptions();
pdfOptions.DocumentOptions.Author = "DevExpress";
pdfOptions.ImageQuality = PdfJpegImageQuality.Medium;
using var pdfStream = new MemoryStream();
workbook.ExportToPdf(pdfStream, pdfOptions);

// Export the first worksheet to HTML
using var htmlStream = new MemoryStream();
workbook.ExportToHtml(htmlStream, 0);

// Export the first worksheet to CSV
workbook.Options.Export.Csv.Worksheet = worksheet.Name;
using var csvStream = new MemoryStream();
workbook.SaveDocument(csvStream, DocumentFormat.Csv);

// Export a cell range as an image
CellRange dataRange = worksheet.GetDataRange();
using var imageStream = new MemoryStream();
dataRange.ExportToImage(imageStream, ImageFileFormat.Png);
Copy

Document Protection & Security

Protect sensitive spreadsheet data with encryption, access control, and digital signatures. Restrict editing,
secure workbook structure, and ensure document integrity across environments.

Encrypt with Password

Protect Excel documents with strong password-based encryption to prevent unauthorized access and protect sensitive data.

Documentation | Demo

Protect Workbook Structure

Prevent users from modifying workbook structure (adding, deleting, or renaming sheets). Configure write protection and mark files as read-only when needed.

Documentation | Demo

Restrict Worksheet Editing

Control editing permissions at the worksheet level. Lock cells, define allowed actions, and prevent unintended modifications while preserving user interaction where needed.

Documentation | Demo

Manage Editable Ranges

Define editable ranges within protected worksheets. Grant specific users or groups permission to modify selected areas while keeping the rest of the content locked.

Documentation

Sign Excel Files

Apply digital signatures to verify document authenticity and ensure content has not been altered after signing.

Documentation | Demo

  • C#
using DevExpress.Spreadsheet;

using var inputStream = new MemoryStream(File.ReadAllBytes("Template.xlsx"));
using var workbook = new Workbook();
workbook.LoadDocument(inputStream, DocumentFormat.Xlsx);
Worksheet worksheet = workbook.Worksheets[0];

// Protect the workbook structure with a password
if (!workbook.IsProtected)
    workbook.Protect("workbook_Password", true, true);

// Protect the worksheet from editing
if (!worksheet.IsProtected)
{
    worksheet.GetDataRange().Protection.Locked = true;
    worksheet.Protect("sheet_Password", WorksheetProtectionPermissions.Default);
}

// Encrypt the workbook with a password on save.
var encryptionSettings = new EncryptionSettings();
encryptionSettings.Type = EncryptionType.Strong;
encryptionSettings.Password = "encryption_Password";

using var outputStream = new MemoryStream();
workbook.SaveDocument(outputStream, DocumentFormat.Xlsx, encryptionSettings);
Copy

Charts & Data Visualization

Visualize spreadsheet data using fully customizable charts. Create, and customize
a wide range of chart types to present insights clearly and effectively.

Chart Types

Add and customize 80+ chart types (2D and 3D options). Use Office 2016 chart types such as Funnel, Histogram, Treemap, and Waterfall. Combine different chart types on one diagram.

Documentation

Manage Chart Settings

Customize chart elements, including axes, series, data points, labels, legends, data tables, and titles. Fine-tune layout and styling to create presentation-ready visualizations.

Documentation

Bind Charts to Data

Link charts to worksheet ranges and dynamically update visuals when source data changes.

Documentation

Apply Chart Templates

Import chart settings from Chart Template files (.CRTX) to ensure consistent chart appearance across documents.

Documentation

  • C#
using DevExpress.Spreadsheet;
using DevExpress.Spreadsheet.Charts;

using var workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Name = "Dashboard";

// Import data for chart & pivot table
worksheet.Import(new object[,] {
        { "Region", "Q1 Sales", "Q2 Sales" },
        { "North", 4500, 5200 },
        { "South", 3200, 3800 },
        { "East", 5100, 4700 },
        { "West", 2800, 3100 }
    }, 0, 0);
CellRange dataRange = worksheet.GetDataRange();

// Create a clustered column chart
Chart chart = worksheet.Charts.Add(ChartType.ColumnClustered, dataRange);
chart.TopLeftCell = worksheet.Cells["E2"];
chart.BottomRightCell = worksheet.Cells["L15"];
chart.Title.SetValue("Quarterly Sales by Region");
chart.Style = ChartStyle.ColorGradient;

using var outputStream = new MemoryStream();
workbook.SaveDocument(outputStream, DocumentFormat.Xlsx);
Copy

Shape & Interactive Object Support

Enhance spreadsheets with rich graphical elements and interactive objects. Add shapes, images,
sparklines, embeddings, and controls to improve presentation and usability.

Insert Shapes & Connectors

Add, remove, and customize shapes, text boxes, and connectors to highlight content and enhance document structure.

Documentation

Manage Document Images

Insert images in multiple formats (PNG, JPG, BMP, SVG, and more) and manage their size, position, cropping, and formatting within the document.

Documentation

Insert Sparklines

Embed lightweight charts within cells to visualize trends and patterns directly in the worksheet.

Documentation

Manage Form Controls

Insert and configure interactive form controls (buttons, checkboxes, combo boxes) to enhance user interaction within spreadsheets.

Documentation

Format Shapes

Customize shape appearance with fill, outline, size, rotation, and positioning options. Control z-order and anchoring to precisely align elements within the worksheet. Group and ungroup shapes and elements.

Documentation

Accessibility Settings

Set alternative text and descriptions for compatibility with accessibility tools. Mark visuals as decorative to hide them from screen readers.

Documentation

Embed Files as OLE Objects

Link and embed external files as OLE objects to include additional content or references.

Documentation

  • C#
using DevExpress.Spreadsheet;
using System.Drawing;

using var workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];

// Insert an image
Picture picture = worksheet.Pictures.AddPicture("image.png", worksheet.Cells["B2"]);
picture.Width = 150; picture.Height = 100;

// Add a textbox
Cell cell = worksheet.Cells["D4"];
Shape textbox = worksheet.Shapes.AddShape(ShapeGeometryPreset.Rectangle, cell, 200, 80);
textbox.ShapeText.Characters().Text = "Quarterly Sales Overview";
textbox.Fill.SetSolidFill(Color.LightBlue);

// Set alternative text for textbox
picture.AlternativeText = "Sample product preview image";
textbox.AlternativeText = "Report title";

// Adjust positioning
textbox.Placement = Placement.MoveAndSize;
picture.Placement = Placement.Move;

// Group picture and textbox
worksheet.Shapes.GroupShapes(new Shape[] { picture, textbox });

// Save the document
using var outputStream = new MemoryStream();
workbook.SaveDocument(outputStream, DocumentFormat.Xlsx);
Copy

Styles & Formatting

Customize spreadsheet appearance with advanced formatting APIs. Apply styles and direct formatting,
use themes, and leverage conditional rules to create clear and consistent Excel documents.

Cell Styles & Formatting

Apply predefined and custom styles to cell ranges. Control number formats, fonts, alignment, borders, fills, and protection settings for precise formatting. Use culture-specific formats for dates, currencies, and numbers.

Documentation

Table and Pivot Table Styles

Format tables and pivot tables using predefined or custom styles. Customize borders, colors, and alignment, and apply banded row, column, and header highlighting.

Documentation

Conditional Formatting

Apply rule-based formatting using color scales, data bars, icon sets, and custom formulas to highlight trends and patterns in your data.

Documentation

Rich Text in Cells

Apply multiple fonts, colors, and styles within a single cell to emphasize important content and improve readability.

Documentation

Themes and Colors

Use theme-based color schemes to maintain visual consistency across documents. Create custom themes, reuse existing ones, or import themes from external THMX files.

Documentation

Font Management

Ensure consistent export and rendering across platforms by using custom fonts and defining substitutions when fonts are unavailable in the current environment.

Documentation

  • C#
using DevExpress.Spreadsheet;
using System.Drawing;

using var inputStream = new MemoryStream(File.ReadAllBytes("Document.xlsx"));
Workbook workbook = new Workbook();
workbook.LoadDocument(inputStream, DocumentFormat.Xlsx);
Worksheet worksheet = workbook.Worksheets[0];

// Create and apply a custom style
Style customStyle = workbook.Styles.Add("CustomStyle");
customStyle.Font.Name = "Times New Roman";
customStyle.Font.Size = 12;
customStyle.Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center;
customStyle.Borders.SetAllBorders(Color.Gray, BorderLineStyle.Thin);
CellRange dataRange = worksheet.GetDataRange();
dataRange.Style = customStyle;

// Set custom theme colors
workbook.Theme.SetColors(new ThemeColorScheme()
{
    Accent1 = Color.FromArgb(79, 129, 189),
    Accent2 = Color.FromArgb(192, 80, 77),
    Accent3 = Color.FromArgb(155, 187, 89),
    Accent4 = Color.FromArgb(128, 100, 162),
    Accent5 = Color.FromArgb(75, 172, 198),
    Accent6 = Color.FromArgb(247, 150, 70)
});

// Save the document
using var outputStream = new MemoryStream();
workbook.SaveDocument(outputStream, DocumentFormat.Xlsx);
Copy

Data Import & Binding

Automate Excel document generation and connect spreadsheets to external data sources.
Import, bind, and transform data to build dynamic, data-driven documents.

Bind Ranges and Tables to Data Sources

Bind worksheet ranges and tables to external data sources such as DataTables and binding lists. Automatically reflect data changes and maintain synchronization between data and spreadsheet content.

Documentation

Use Spreadsheet as a Data Source

Transform a cell range or a worksheet table into a data source that can be used to visualize data in any data-aware control.

Documentation

Data Import & Export

Import data from arrays, lists, custom objects, and DataTables into worksheets. Export cell ranges to structured data tables for further processing. Use custom converters to manage and customize the output.

Documentation

Spreadsheet Mail Merge

Programmatically generate mail-merge templates using FIELD, FIELDPICTURE, RANGE, and PARAMETER placeholders. Bind structured data to worksheet regions and create simple or hierarchical documents such as reports, invoices, and summaries.

Documentation

  • C#
using DevExpress.Spreadsheet;
using System.Data;

// Create a DataTable
DataTable table = new DataTable("Sales");
table.Columns.Add("Product", typeof(string));
table.Columns.Add("Region", typeof(string));
table.Columns.Add("Amount", typeof(decimal));

table.Rows.Add("Laptop", "North", 1200m);
table.Rows.Add("Tablet", "West", 800m);
table.Rows.Add("Phone", "East", 650m);

// Create a workbook 
using var workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];

// Import DataTable into worksheet starting from cell A1
worksheet.Import(table, true, 0, 0);

// Format header row and auto-fit columns
CellRange header = worksheet.Range["A1:C1"];
header.Font.Bold = true;
worksheet.Columns.AutoFit(0, 2);

// Save the document
using var outputStream = new MemoryStream();
workbook.SaveDocument(outputStream, DocumentFormat.Xlsx);
Copy

FAQ — Spreadsheet Document API

 
Is Microsoft Excel® required to create spreadsheets with the DevExpress Spreadsheet API?

No. You do not need to install Microsoft Excel® to generate XLS, XLSX, CSV, or other supported formats. DevExpress Spreadsheet Document API is a standalone library that creates spreadsheets programmatically.

Does the Spreadsheet Document API support .NET?

Yes. DevExpress Spreadsheet Document API supports .NET 10, .NET 9, and .NET 8. Our Excel file generation API works in apps that run on Windows, Linux, and macOS. You can deploy your apps on Azure and AWS.

What .NET Framework versions does the Spreadsheet Document API support?

DevExpress Spreadsheet Document API supports .NET Framework 4.6.2, 4.7, and 4.8 (current version v25.2). For complete version compatibility information, refer to our prerequisites documentation: Office File API Prerequisites.

How is the Spreadsheet Document API licensed?

DevExpress Spreadsheet Document API is licensed per developer. Each developer using the API requires an individual license. Licensing is not based on the number of machines, deployments, CPUs, or end users.

The Spreadsheet Document is available through two licensing options:

For complete licensing terms, refer to the DevExpress End-User License Agreement.

Which Microsoft Excel® file formats does the DevExpress Spreadsheet API support? What other file formats are supported?

The DevExpress Spreadsheet API supports Microsoft's XLS and XLSX file formats. Our Spreadsheet API also supports CSV.

Which NuGet package do I need for the Spreadsheet API?

Install the DevExpress.Document.Processor NuGet package or for .NET Framework projects using the DevExpress Unified Component Installer, reference the following v25.2+ assemblies:

  • DevExpress.Charts.Core.dll
  • DevExpress.Data.dll
  • DevExpress.DataAccess.dll
  • DevExpress.DataVisualization.Core.dll
  • DevExpress.Docs.dll
  • DevExpress.Drawing.dll
  • DevExpress.Office.Core.dll
  • DevExpress.Pdf.Core.dll
  • DevExpress.Printing.Core.dll
  • DevExpress.Sparkline.Core.dll
  • DevExpress.Spreadsheet.Core.dll
  • DevExpress.TreeMap.Core.dll
  • DevExpress.XtraCharts.dll
  • DevExpress.XtraTreeMap.dll
What can I do with the Spreadsheet API?

DevExpress Spreadsheet Document API allows you to create, load, modify, save, and export spreadsheet documents programmatically. You can manage worksheets (create, rename, copy, hide, delete), work with rows, columns, and cells, apply formatting and styles, create and calculate formulas using over 400 Excel-compatible functions, work with charts and sparklines, add shapes and pictures, create pivot tables, manage tables and defined names, apply data validation, protect worksheets and workbooks, digitally sign documents, and export to PDF and HTML.

Does the Spreadsheet API include AI-powered features?

Yes. The DevExpress Spreadsheet API includes AI-powered extensions. These extensions integrate with language models via Microsoft.Extensions.AI and support translation, summarization, and contextual question answering for spreadsheet content.

To use AI extensions, install the DevExpress.AIIntegration.Docs NuGet package.

Refer to our documentation for implementation details: AI-powered Extensions for DevExpress Office File API.

How do I load a spreadsheet and export it to PDF?

  • C#
using DevExpress.Spreadsheet;

using (Workbook workbook = new Workbook()) { 
    workbook.LoadDocument("report.xlsx"); 
    workbook.Calculate(); 
    workbook.ExportToPdf("report.pdf"); 
}
Copy

How do I define a formula for a cell?

  • C#
using DevExpress.Spreadsheet;

using (Workbook workbook = new Workbook()) { 
    Worksheet sheet = workbook.Worksheets[0]; 
    sheet.Cells["D2"].FormulaInvariant = "=B2*C2"; 
    sheet.Cells["E10"].FormulaInvariant = "=SUM(E2:E9)"; 
}
Copy

How do I create an array formula?

  • C#
using DevExpress.Spreadsheet;

using (Workbook workbook = new Workbook()) { 
    Worksheet sheet = workbook.Worksheets[0]; 
    sheet.Range["D2:D5"].ArrayFormula = "=B2:B5*C2:C5"; 
    workbook.SaveDocument("arrayformula.xlsx"); 
}
Copy

How do I create a chart?

  • C#
using DevExpress.Spreadsheet;

using (Workbook workbook = new Workbook()) { 
    Worksheet sheet = workbook.Worksheets[0]; 
    sheet["A1"].Value = "Month"; 
    sheet["B1"].Value = "Sales"; 
    Chart chart = sheet.Charts.Add(ChartType.ColumnClustered); 
    chart.SelectData(sheet["A1:B3"]); 
    workbook.SaveDocument("chart.xlsx"); 
}
Copy

How do I get started with the Spreadsheet Document API?