Skip to main content

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.v24.1.Core.dll

NuGet Package: DevExpress.Printing.Core

Declaration

public static ExportType DefaultExportType { get; set; }

Property Value

Type Description
ExportType

The default export mode.

Available values:

Name Description
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.

    When exporting to MS Excel format, various data shaping options that exist in an exported control (e.g., data grouping, summaries, format rules) will persist in the output XLS-XLSX document. When exporting to CSV, the data shaping options (group rows, summaries, etc.) and item indentation are not retained in the output document.

  • 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.

See Also