Pivot Grid: Data Export
- 3 minutes to read
VCL Pivot Grid controls ship with a series of global data export methods declared in the cxExportPivotGridLink unit. You can call these methods to export pivot grid content to a file in CSV, HTML, TXT, XLS, XLSX, and XML formats. To track export progress and perform additional actions before an export operation, you can pass a handler object as the optional AHandler
parameter available for every data export method. The handler object should implement the IcxExportProgress and/or IcxExportBeforeSave interfaces declared in the cxExport unit. Refer to the following topic for detailed information on handler objects and a code example: How to: Track Data Export Progress.
#Plain Text-Based Formats
Plain text-based formats include CSV and TXT. Use these lean formats if you need to keep the exported data size to a minimum. Remember that plain text-based formats cannot preserve data layouts and appearance settings as customized by you or your users.
In comma-separated values (CSV) format, every plain text line of values separated by commas corresponds to a data record. You can pass another character as the optional ASeparator
parameter to use it instead of a comma. Like CSV, the plain text format stores exported data as plain text without formatting, style, or print layout information. Compared to CSV, exported TXT files are more human-readable. You can use the optional ASeparator
, ABeginString
, and AEndString
parameters of the export methods to delimit cell values in the resulting file or stream.
- cxExportPivotGridToCSV
- Exports content of a pivot grid to a file in CSV (comma-separated values) format.
- cxExportPivotGridToText
- Exports content of a pivot grid to a file in plain text format.
#Markup Language Formats
Markup language formats include HTML and XML. Unlike plain text, these formats allow you to export the original data layout as is and take style and look & feel settings into account. Export methods in this category create image files to display cell images as inline images in the output file or stream.
- cxExportPivotGridToHTML
- Exports content of a pivot grid to a file in HTML format.
- cxExportPivotGridToXML
- Exports content of a pivot grid to a file in XML format.
#Spreadsheet Document Formats
Spreadsheet document formats include Office Open XML (XLSX) and Microsoft Excel® binary spreadsheet (XLS) formats. Like markup language formats, they allow you to export grid content as is, including the data layout, style, and look & feel settings.
- cxExportPivotGridDataToExcel
- Exports unformatted data from a pivot grid to a file in XLS or XLSX format.
- cxExportPivotGridToExcel
- Exports content of a pivot grid to a file in Microsoft Excel® binary format (XLS).
- cxExportPivotGridToXLSX
- Exports content of a pivot grid to a file in Office Open XML spreadsheet format (XLSX).
#Universal Data Export Method
You can call the cxExportPivotGridToFile procedure to save content of the specified pivot grid to a file in any of the supported data formats.