.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Row

Workbook.SaveDocument(String, DocumentFormat) Method

Saves the document to a file in the specified document format.

You need an active license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use this method in production code.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Docs.v20.1.dll

Declaration

public void SaveDocument(
    string fileName,
    DocumentFormat format
)
Public Sub SaveDocument(
    fileName As String,
    format As DocumentFormat
)

Parameters

Name Type Description
fileName String

Specifies the file path to save the document.

format DocumentFormat

A DocumentFormat enumeration value that specifies the document's format.

Remarks

Use the Workbook.Options.Export property or Workbook.BeforeExport event to specify export options.

Examples

Call the Workbook.SaveDocument method with the specified file path to save a workbook to the file. Specify the file format as the second parameter of the method using the DocumentFormat enumerator.

// Add a reference to the DevExpress.Docs.dll assembly.
using DevExpress.Spreadsheet;
// ...

Workbook workbook = new Workbook();
// ...

// Save the modified document to the file.
workbook.SaveDocument("Documents\\SavedDocument.xlsx", DocumentFormat.Xlsx);
See Also