[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Expand]Reporting
  [Expand]Chart Control
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Binding to Data
   [Expand]Data Shaping
   [Expand]Data Analysis
   [Expand]Data Formatting
   [Expand]Layout
   [Expand]Appearance
   [Collapse]Export
     Export Overview
     Export to Tabular Formats
   [Expand]Design-Time Features
   [Expand]UI Elements
   [Expand]Examples
   [Expand]End-User Capabilities
   [Expand]Member Tables
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Scheduler
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Gauges
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Export to Tabular Formats

Export to tabular data formats (CSV, XLS, XLSX) uses a data engine specified by the ExportType enumeration. Default engine performs a Data-Aware export with improved performance and memory usage. The resultant file is optimized for subsequent analysis with Microsoft Excel.

Expanded Data-Aware Export

The following features are retained in the XLS and XLSX documents:

  • Data Grouping - you can collapse/expand groups within a worksheet.
  • Fixed Headers - column and row areas stay in sight.
  • Cells Formatting - retains the number format.
  • Display Text/Value export - you can select whether to export display text or values.

Methods

Methods that perform the data-aware export are listed in the following table.

Method Parameter
ASPxPivotGridExporter.ExportToCsv or ASPxPivotGridExporter.ExportCsvToResponse Use the CsvExportOptionsEx instance instead of the CsvExportOptions object specified in the method signature.
The CsvExportOptionsEx.ExportType property should be set to the ExportType.DataAware value (default).
ASPxPivotGridExporter.ExportToXls or ASPxPivotGridExporter.ExportXlsToResponse Use the PivotXlsExportOptions instance instead of the XlsExportOptions object specified in the method signature.
The PivotXlsExportOptions.ExportType (inherited XlsExportOptionsEx.ExportType) property should be set to the ExportType.DataAware value (default).
ASPxPivotGridExporter.ExportToXlsx or ASPxPivotGridExporter.ExportXlsxToResponse Use the PivotXlsxExportOptions instance instead of the XlsxExportOptions object specified in the method signature.
The PivotXlsxExportOptions.ExportType (inherited XlsxExportOptionsEx.ExportType) property should be set to the ExportType.DataAware value (default).

Options

The PivotXlsExportOptions and PivotXlsxExportOptions classes inherits many properties from the XlsExportOptionsEx and XlsxExportOptionsEx classes, respectively. The data-aware export engine uses only a subset of available properties. To clarify the situation, the table below lists the properties which are in effect in the Data Aware mode.

Property Description
XlExportOptionsBase.SheetName Gets or sets a name of the sheet in the created XLS file to which a document is exported.
XlsExportOptionsEx.AllowFixedColumns
XlsxExportOptionsEx.AllowFixedColumns
Gets or sets whether the row area in a Pivot Grid control becomes a frozen pane in the spreadsheet.
XlsExportOptionsEx.AllowFixedColumnHeaderPanel
XlsxExportOptionsEx.AllowFixedColumnHeaderPanel
Gets or sets whether the column area becomes a frozen pane in the spreadsheet.
XlsExportOptionsEx.AllowGrouping
XlsxExportOptionsEx.AllowGrouping
Gets or sets whether the data in the spreadsheet are grouped as they are displayed in the Pivot Grid control.
XlsExportOptionsEx.ShowPageTitle
XlsxExportOptionsEx.ShowPageTitle
Gets or sets whether a title is displayed for each printed page of the exported document.
XlsExportOptionsEx.ExportType
XlsxExportOptionsEx.ExportType
Gets or sets the export mode. You can switch between WYSIWYG and data-aware export type.
XlsExportOptionsEx.GroupState
XlsxExportOptionsEx.GroupState
Gets or sets whether groups are collapsed or expanded in the exported document.
XlExportOptionsBase.RawDataMode Enables the mode that produces simple tabular data without graphic elements, style and appearance settings.
XlExportOptionsBase.TextExportMode Specifies whether data are exported as strings or values.

Runtime Customization

To customize exported pivot grid elements individually, handle the following events:

Event Description
PivotXlsExportOptions.CustomizeCell Allows you to specify cell formatting when exporting a Pivot Grid control to XLSX format in data-aware mode.
XlsExportOptionsEx.AfterAddRow Fires immediately after a row is added to the output document. Only available in data-aware export mode.
XlsExportOptionsEx.BeforeExportTable Allows you to customize a native Excel table's settings before export. This event is in effect when the LayoutMode property is set to Table. Only available in data-aware export mode.
XlsExportOptionsEx.CustomizeDocumentColumn Allows you to customize an individual column in the exported document - change its width, formatting, collapse the group containing the column or hide the column.
XlsExportOptionsEx.CustomizeSheetFooter Allows you to add a footer to the output document. Only available in data-aware export mode.
XlsExportOptionsEx.CustomizeSheetHeader Allows you to add a header to the output document. Only available in data-aware export mode.
XlsExportOptionsEx.CustomizeSheetSettings Allows you to customize the output document's settings. Only available in data-aware export mode.
XlsExportOptionsEx.DocumentColumnFiltering Allows you to apply filters to the exported document's columns. Only available in data-aware export mode.
XlsExportOptionsEx.SkipFooterRow Allows you to hide certain summary footers (or certain multi-line summary footers' lines) from the exported document. Only available in data-aware export mode.

Expanded WYSIWYG Export

The WYSIWYG export mode employs the XtraPrinting library engine. It reproduces the layout of control elements in XLS and XLSX formats, omitting data shaping characteristics available in the DataAware export mode. In CSV format, WYSIWYG mode may export column headers and empty columns for accurate visual representation.

Methods that perform the export in WYSIWYG mode are listed in the following table.

Method Parameter
ASPxPivotGridExporter.ExportToCsv or ASPxPivotGridExporter.ExportCsvToResponse Use the CsvExportOptionsEx instance instead of the CsvExportOptions object specified in the method signature.
The CsvExportOptionsEx.ExportType property should be set to the ExportType.WYSIWYG value.
ASPxPivotGridExporter.ExportToXls or ASPxPivotGridExporter.ExportXlsToResponse Use the PivotXlsExportOptions instance instead of the XlsExportOptions object specified in the method signature.
The PivotXlsExportOptions.ExportType (inherited XlsExportOptionsEx.ExportType) property should be set to the ExportType.WYSIWYG value.
ASPxPivotGridExporter.ExportToXlsx or ASPxPivotGridExporter.ExportXlsxToResponse Use the PivotXlsxExportOptions instance instead of the XlsxExportOptions object specified in the method signature.
The PivotXlsxExportOptions.ExportType (inherited XlsxExportOptionsEx.ExportType) property should be set to the ExportType.WYSIWYG value.

Options

The PivotXlsExportOptions and PivotXlsxExportOptions classes inherits many properties from the XlsExportOptionsEx and XlsxExportOptionsEx classes, respectively. The WYSIWYG mode (the Printing Library export engine) uses only a subset of available properties. To clarify the situation, the table below lists the properties which are in effect in the WYSIWYG mode.

Property Description
XlExportOptionsBase.DocumentOptions Provides access to options to be embedded as the resulting XLS or XLSX file's Document Properties.
XlExportOptionsBase.EncryptionOptions Provides access to the XLS and XLSX file encryption options.
PivotXlsExportOptionsBase.ExportColumnAreaHeaders Gets or sets whether to include the column field headers in the XLS exported document.
PivotXlsExportOptionsBase.ExportDataAreaHeaders Gets or sets whether to include the data field headers in the XLS exported document.
PivotXlsExportOptionsBase.ExportFilterAreaHeaders Gets or sets whether to include the filter field headers in the XLS exported document.
XlsExportOptions.ExportMode Specifies whether the document should be exported to a single or different XLS files, each page in a separate file.
PivotXlsExportOptionsBase.ExportRowAreaHeaders Gets or sets whether to include the row field headers in the XLS exported document.
XlsExportOptionsEx.ExportType Gets or sets the export type - WYSIWYG or Data Aware.
XlExportOptionsBase.IgnoreErrors Specifies the document errors to be ignored in a resulting Excel file.
XlExportOptionsBase.RawDataMode Enables the mode that produces simple tabular data without graphic elements, style and appearance settings.
XlExportOptionsBase.RightToLeftDocument Gets or sets whether the layout of the resulting XLS document should be aligned to support locales using right-to-left fonts.
XlExportOptionsBase.SheetName Gets or sets a name of the sheet in the created XLS file to which a document is exported.
XlExportOptionsBase.ShowGridLines Gets or sets a value indicating whether the grid lines should be visible in the resulting XLS file.
XlsExportOptions.Suppress256ColumnsWarning Gets or sets a value indicating whether to suppress the exception that raises when trying to export a document to an XLS file with more than 256 columns.
XlsExportOptions.Suppress65536RowsWarning Gets or sets a value indicating whether to suppress the exception that raises when trying to export a document to an XLS file with more than 65,536 rows.
XlExportOptionsBase.TextExportMode Gets or sets a value indicating whether the cells in the resulting XLS document should use the same formatting as the original document.

Expanded See Also

Is this topic helpful?​​​​​​​