Back to Devexpress

ExportSettings.DefaultExportType Property

corelibraries-devexpress-dot-export-dot-exportsettings.md

latest8.5 KB
Original Source

ExportSettings.DefaultExportType Property

Gets or sets the default mode of a control’s data export to XLS(x) and CSV formats. Choosing the export mode is only supported for certain controls.

Namespace : DevExpress.Export

Assembly : DevExpress.Printing.v25.2.Core.dll

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
public static ExportType DefaultExportType { get; set; }
vb
Public Shared Property DefaultExportType As ExportType

Property Value

TypeDescription
ExportType

The default export mode.

|

Available values:

NameDescription
Default

The default export mode.

For the ExportSettings.DefaultExportType property, the Default value is equivalent to the DataAware value.

If the XlsxExportOptionsEx.ExportType, XlsExportOptionsEx.ExportType or CsvExportOptionsEx.ExportType property is set to Default , the actual export mode is specified by the ExportSettings.DefaultExportType property.

| | DataAware |

Export type that uses a new data export engine that features improved performance and memory usage. When exporting to XLS and XLSX formats, specific data-shaping options (e.g., summaries, filtering, sorting, data groups and lookup values) of a source control are retained in the export output. When exporting to CSV format, the control’s data shaping options are not included in the export document, which simplifies subsequent analysis and processing of text data.

The layout of control elements may not be retained in the export document. Other limitations also apply.

Not all controls support the DataAware export mode.

| | WYSIWYG |

Export type that uses the export engine of the XtraPrinting library. When exporting to XLS and XLSX formats, the layout of control elements is retained in the export document; specific data shaping options are not retained, compared to the DataAware export mode.

|

Remarks

Certain DevExpress controls support two modes (export engines) for data export to XLS(x) and CSV formats. Use the static DefaultExportType property to specify the default export mode for these controls.

  • Data-aware mode - The new export engine that features improved performance and memory usage. It is optimized for subsequent analysis of exported data. The layout of control elements may not be retained in the export document. Multiple events and options in data-aware export mode give you flexibility for output document customization.

  • WYSIWYG mode - In this export mode, the layout of control elements and all display text is retained in the output document. Text items/cells are indented in the output document according to the layout of elements in the exported control. Thus, when exporting to CSV in WYSIWYG mode, the resulting document contains all text data, summary values, group rows, etc., indented if necessary.

Supported controls include:

To export data in data-aware or WYSIWYG mode, use the ExportToXls , ExportToXlsx and ExportToCsv methods an exported control provides. Other approaches of exporting controls to XLS(x) and CSV formats (e.g., using the PrintableComponentLink and Reporting Library) employ the WYSIWYG export engine and do not support data-aware export mode.

The supported controls provide the ExportToXls , ExportToXlsx and ExportToCsv method overloads that have the options parameter. Using these overloads, you can explicitly specify the export mode and customize export behavior for a specific method call.

Initialize the options parameter with the following class objects:

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DefaultExportType property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-grid-customize-data-aware-export-output/CS/GridDataAwareExportCustomization/Form1.cs#L40

csharp
// Ensure that the data-aware export mode is enabled.
ExportSettings.DefaultExportType = ExportType.DataAware;
// Create a new object defining how a document is exported to the XLSX format.

winforms-grid-customize-data-aware-export-output/VB/GridDataAwareExportCustomization/Form1.vb#L43

vb
' Ensure that the data-aware export mode is enabled.
ExportSettings.DefaultExportType = ExportType.DataAware
' Create a new object defining how a document is exported to the XLSX format.

See Also

XlsxExportOptionsEx.ExportType

XlsExportOptionsEx.ExportType

CsvExportOptionsEx.ExportType

Export to XLS, XLSX, CSV Formats

ExportSettings Class

ExportSettings Members

DevExpress.Export Namespace