A newer version of this page is available. Switch to the current version.

CsvExportOptionsEx Class

Contains options that define how a control is exported to CSV format in data-aware export mode.

Namespace: DevExpress.XtraPrinting

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

Declaration

public class CsvExportOptionsEx :
    CsvExportOptions,
    IDataAwareExportOptions
Public Class CsvExportOptionsEx
    Inherits CsvExportOptions
    Implements IDataAwareExportOptions

Remarks

Specific controls (e.g., GridControl) support data-aware and WYSIWYG modes when exporting their data to CSV and Xls(x) formats. The static ExportSettings.DefaultExportType property allows you to choose the default export mode for these controls. See the ExportSettings.DefaultExportType topic to learn the difference between export modes, the controls that support this functionality, how to choose the export type and invoke export methods.

When exporting a control to CSV format in data-aware mode, only data cells along with column headers are included in the output document, which allows for simplified subsequent data parsing and processing. The features and data shaping elements below are not included in the output document:

  • Summaries
  • Cell merging
  • Group rows
  • Horizontal and vertical lines between cells

The following image shows a sample grid with grouping and summaries enabled (on the left), and the result of exporting this control to CSV format in data-aware mode (on the right).

csv-grid-data-aware-export

In WYSIWYG mode, data cells are exported to CSV format along with other control elements. The resultant CSV format will contain text lines corresponding to group rows, data cell indentations, and summary footers, provided that these elements are visible in the source control.

To export a control's data to CSV format, use the control's ExportToCsv method. Additional export customization is available when using the ExportToCsv method overloads that take the options parameter.

In data-aware export mode, set this parameter to a CsvExportOptionsEx class object (descendant of the CsvExportOptions class). The CsvExportOptionsEx class extends its base class with additional options and events related to data-aware mode. In WYSIWYG export mode, initialize the options parameter with a CsvExportOptions class object.

The desired export mode can be specified with each call of the ExportToCsv method (when using this method’s overloads with the options parameter). Initialize the options parameter with a CsvExportOptionsEx object, whose CsvExportOptionsEx.ExportType property is set to ExportType.DataAware or ExportType.WYSIWYG.

A few options that are inherited by the CsvExportOptionsEx class from its ancestors are not supported by the data-aware export engine. See the description of the base classes' members to learn more.

See Also