The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+
Row

DocumentFormat Struct

A document format.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v19.2.Core.dll

Declaration

[ComVisible(false)]
public struct DocumentFormat :
    IConvertToInt<DocumentFormat>
<ComVisible(False)>
Public Structure DocumentFormat
    Implements IConvertToInt(Of DocumentFormat)
[TypeConverter(typeof(DocumentFormatTypeConverter))]
[ComVisible(false)]
public struct DocumentFormat :
    IConvertToInt<DocumentFormat>
<TypeConverter(GetType(DocumentFormatTypeConverter))>
<ComVisible(False)>
Public Structure DocumentFormat
    Implements IConvertToInt(Of DocumentFormat)
[TypeConverter(typeof(DocumentFormatTypeConverter))]
[ComVisible(false)]
public struct DocumentFormat :
    IConvertToInt<DocumentFormat>
<TypeConverter(GetType(DocumentFormatTypeConverter))>
<ComVisible(False)>
Public Structure DocumentFormat
    Implements IConvertToInt(Of DocumentFormat)

Remarks

The DocumentFormat structure introduces fields to specify the file format with which a workbook can be saved or from which it can be loaded. Use the ISpreadsheetComponent.SaveDocument and ISpreadsheetComponent.LoadDocument methods to specify the document format.

The following example illustrates how to save a workbook in XLSX format.

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

Note

Certain methods can throw unhandled exceptions if a problem occurs. Consider the situation when a document is being saved to a locked or read-only file. To prevent application failure, subscribe to the SpreadsheetControl.UnhandledException event and set the SpreadsheetUnhandledExceptionEventArgs.Handled property to true.

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