Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[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
  [Expand]Reporting
  [Expand]Chart Control
  [Expand]Grid View
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]Scheduler
  [Expand]HTML Editor
  [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]Data Export
     Export Overview
     Export to Table Formats (Data-Aware Export)
   [Expand]Design-Time Features
   [Expand]UI Elements
   [Expand]Examples
   [Expand]End-User Capabilities
   [Expand]Member Tables
  [Expand]Tree List
  [Expand]Gauges
  [Expand]Data Editors
  [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]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Export Overview

The Pivot Grid control is shipped with the ASPxPivotGridExporter component. This component allows you to export the ASPxPivotGrid's data to a file or stream in various formats - HTML, MHT, PDF, RTF, TXT, CSV, XLS or XLSX.

Expanded Export Types

Two export types are supported when exporting data from a Pivot Grid control.

  • WYSIWYG Export Type - In this export type, the pivot grid layout is retained in resulting documents. Specific data shaping options (like sorting, grouping, filtering, etc.) are not retained.
  • Data-aware Export Type - The export type, optimized for subsequent analysis of pivot grid data within Microsoft Excel. Various data shaping options that are applied within the pivot grid are retained in output documents. This type is supported for XLS(X) and CSV formats by default. For other formats (PDF, RTF, TXT, etc.) only the WYSIWYG type is available.

By using the XLS(X) and CSV formats you can specify export type in two ways.

  • For all controls - Set the ExportSettings.DefaultExportType static property that allows you to choose the required export type used by default.
  • For each control - Specify export type with each call of the XLS(X) or CSV export methods (when using these method overloads with an options parameter). Create an XlsExportOptionsEx object (or XlsxExportOptionsEx, CsvExportOptionsEx objects), set its ExportType property and pass this object to the XLS(X)/CSV export method.

Expanded Exporting Data

To export the Pivot Grid's data, you need to connect the ASPxPivotGridExporter with the Pivot Grid control you want to export and fire one of the export methods. To do this, assign the pivot grid's ID to the ASPxPivotGridExporter.ASPxPivotGridID property, and use one of the following methods.

Note

If the ASPxPivotGridExporter.ASPxPivotGridID property is not set, the first determined pivot grid on a page will be exported.

Output Format Methods Data-Aware Support Description
HTML ASPxPivotGridExporter.ExportHtmlToResponse
ASPxPivotGridExporter.ExportToHtml
n/a Exports ASPxPivotGrid data to the specified file in HTML format, using the specified character encoding.
MHT ASPxPivotGridExporter.ExportMhtToResponse
ASPxPivotGridExporter.ExportToMht
n/a Exports ASPxPivotGrid data to the specified file in MHT format using the specified character encoding with the specified title. The output file can be compressed (secondary characters such as spaces are removed) if required.
PDF ASPxPivotGridExporter.ExportPdfToResponse
ASPxPivotGridExporter.ExportToPdf
n/a Exports ASPxPivotGrids data to the specified file in PDF format.
RTF ASPxPivotGridExporter.ExportRtfToResponse
ASPxPivotGridExporter.ExportToRtf
n/a Exports ASPxPivotGrid data to the specified file in RTF format.
TXT ASPxPivotGridExporter.ExportTextToResponse
ASPxPivotGridExporter.ExportToText
n/a Exports ASPxPivotGrid data to the specified file in TXT format, using the specified separator string and encoding settings.
CSV ASPxPivotGridExporter.ExportCsvToResponse
ASPxPivotGridExporter.ExportToCsv
Exports the ASPxPivotGrid's data to the specified file in CSV format.
XLS ASPxPivotGridExporter.ExportXlsToResponse
ASPxPivotGridExporter.ExportToXls
Exports ASPxPivotGrid data to the specified file in XLS format using the specified options.
XLSX ASPxPivotGridExporter.ExportXlsxToResponse
ASPxPivotGridExporter.ExportToXlsx
Exports ASPxPivotGrid data to the specified file in XLSX (MS Excel 2007) format using the specified options.

Additional export settings can be customized when calling the ExportToXls(x) method overloads that take an options parameter. This parameter can be set to an XlsExportOptionsEx object (when using the ExportToXls method), to an XlsxExportOptionsEx object (when using the ExportToXlsx method), etc. You can also use the ASPxPivotGridExporter.OptionsPrint property to get an access to the export options.

Expanded Limitations

Note, that the ASPxPivotGridExporter component cannot export the following content.

  • the content of template fields and cells;
  • the results of styles customization;
  • images.

Expanded Example

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T289831.

This example shows how to export the pivot grid's data using the Data-Aware or WYSIWYG types and set the export options.

  • Click the Export to XLSX button to export data using the Data-Aware type. In the exported XLSX file, fixed row headers are disabled and a sheet name is set to "Pivot Grid Export".
  • Click the Export to PDF button to export data using the WYSIWYG type. The Print dialog is displayed when the exported PDF file is opened.

Expanded See Also

How would you rate this topic?​​​​​​​