# Printing and Exporting | WPF Controls | DevExpress Documentation

## Printing and Exporting Basics

The [Pivot Grid](/WPF/7228/controls-and-libraries/pivot-grid) control provides a fast and flexible way to bring its contents to the printed page, or export to a file or stream in various formats - PDF, RTF, XLS, etc. You must manually add the reference to the *DevExpress.Xpf.Printing.v26.1* assembly. Otherwise, data printing and exporting are not allowed.

[Run Demo: Print Templates](dxdemo://Wpf/DXPivotGrid/MainDemo/PrintTemplates)

[Run Demo: Print Options](dxdemo://Wpf/DXPivotGrid/MainDemo/PrintOptions)

To preview the pivot grid, use the following members:

- [PivotGridControl.ShowPrintPreview](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ShowPrintPreview.overloads)
- [PivotGridControl.ShowPrintPreviewDialog](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ShowPrintPreviewDialog.overloads)
- [PivotGridCommands.ShowPrintPreviewDialog](/WPF/DevExpress.Xpf.PivotGrid.PivotGridCommands.ShowPrintPreviewDialog)

The **Print Preview** window allows you to customize the printed document, print it or export to a file in the required format.

The following table lists methods allowing you to export data:

| Method | Description |
| --- | --- |
| [PivotGridControl.ExportToCsv](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ExportToCsv.overloads) | Exports the pivot grid to the specified stream or file path in CSV format. |
| [PivotGridControl.ExportToHtml](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ExportToHtml.overloads) | Exports the pivot grid to the specified stream or file path in HTML format. |
| [PivotGridControl.ExportToImage](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ExportToImage.overloads) | Exports the pivot grid to the specified stream or file path in image format. |
| [PivotGridControl.ExportToMht](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ExportToMht.overloads) | Exports the pivot grid to the specified stream or file path in MHT format. |
| [PivotGridControl.ExportToPdf](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ExportToPdf.overloads) | Exports the pivot grid to the specified stream or file path in PDF format. |
| [PivotGridControl.ExportToText](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ExportToText.overloads) | Exports the pivot grid to the specified stream or file path in text format. |
| [PivotGridControl.ExportToXls](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ExportToXls.overloads) | Exports the pivot grid to the specified stream or file path in XLS format. |
| [PivotGridControl.ExportToXlsx](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ExportToXlsx.overloads) | Exports the pivot grid to the specified stream or file path in XLSX format. |
| [PivotGridControl.ExportToXps](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.ExportToXps.overloads) | Exports the pivot grid to the specified stream or file path in XPS format. |

## Data Aware Export

When exporting to tabular formats (CSV, XLS, XLSX), the export engine uses the Excel Export Library to perform a **Data-Aware** export with improved performance and reduced memory usage. The resultant file is optimized for subsequent analysis in Microsoft Excel. For more information, refer to the [Export to Tabular Formats (CSV, XLS, XLSX)](/WPF/400439/controls-and-libraries/pivot-grid/printing-and-exporting/export-to-tabular-formats) document.

## Printing Options and Settings

The DXPivotGrid provides multiple options, styles and templates, that allow you to customize the printed document.

The following table lists printing options:

| Property | Description |
| --- | --- |
| [PivotGridControl.PrintColumnHeaders](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintColumnHeaders) | Gets or sets whether to print [headers](/WPF/7993/controls-and-libraries/pivot-grid/ui-elements/field-header) of the [column fields](/WPF/7985/controls-and-libraries/pivot-grid/ui-elements/column-field). This is a dependency property. |
| [PivotGridControl.PrintDataHeaders](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintDataHeaders) | Gets or sets whether to print [headers](/WPF/7993/controls-and-libraries/pivot-grid/ui-elements/field-header) of the [data fields](/WPF/7988/controls-and-libraries/pivot-grid/ui-elements/data-field). This is a dependency property. |
| [PivotGridControl.PrintFilterHeaders](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintFilterHeaders) | Gets or sets whether to print [headers](/WPF/7993/controls-and-libraries/pivot-grid/ui-elements/field-header) of the [filter fields](/WPF/7998/controls-and-libraries/pivot-grid/ui-elements/filter-field). This is a dependency property. |
| [PivotGridControl.PrintHeadersOnEveryPage](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintHeadersOnEveryPage) | Gets or sets whether to print [field headers](/WPF/7993/controls-and-libraries/pivot-grid/ui-elements/field-header) on every page. This is a dependency property. |
| [PivotGridControl.PrintHorzLines](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintHorzLines) | Gets or sets whether the horizontal grid lines are printed.<br>This is a dependency property. |
| [PivotGridControl.PrintInsertPageBreaks](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintInsertPageBreaks) | Gets or sets whether to insert page breaks at the end of every page. This is a dependency property. |
| [PivotGridControl.PrintLayoutMode](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintLayoutMode) | Gets or sets the layout mode of the print document. This is a dependency property. |
| [PivotGridControl.PrintRowHeaders](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintRowHeaders) | Gets or sets whether to print [headers](/WPF/7993/controls-and-libraries/pivot-grid/ui-elements/field-header) of the [row fields](/WPF/8004/controls-and-libraries/pivot-grid/ui-elements/row-field). This is a dependency property. |
| [PivotGridControl.PrintUnusedFilterFields](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintUnusedFilterFields) | Gets or sets whether to print [headers](/WPF/7993/controls-and-libraries/pivot-grid/ui-elements/field-header) of the unused [filter fields](/WPF/7998/controls-and-libraries/pivot-grid/ui-elements/filter-field). This is a dependency property. |
| [PivotGridControl.PrintVertLines](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintVertLines) | Gets or sets whether the vertical grid lines are printed.<br>This is a dependency property. |

The following table lists the templates applied to DXPivotGrid elements when they are printed.

| Property | Description |
| --- | --- |
| [PivotGridControl.PrintFieldCellTemplate](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintFieldCellTemplate)<br><br><br>[PivotGridControl.PrintFieldCellTemplateSelector](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintFieldCellTemplateSelector)<br><br><br>[PivotGridControl.PrintFieldCellKpiTemplate](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintFieldCellKpiTemplate)<br><br><br>[PivotGridControl.PrintFieldCellKpiTemplateSelector](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintFieldCellKpiTemplateSelector)<br><br><br>[PivotGridField.PrintCellTemplate](/WPF/DevExpress.Xpf.PivotGrid.PivotGridField.PrintCellTemplate)<br><br><br>[PivotGridField.PrintCellTemplateSelector](/WPF/DevExpress.Xpf.PivotGrid.PivotGridField.PrintCellTemplateSelector) | Specify the template that defines the presentation of the [data cells](/WPF/7984/controls-and-libraries/pivot-grid/ui-elements/cell) when the pivot grid is printed. |
| [PivotGridControl.PrintFieldHeaderTemplate](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintFieldHeaderTemplate)<br><br><br>[PivotGridControl.PrintFieldHeaderTemplateSelector](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintFieldHeaderTemplateSelector)<br><br><br>[PivotGridField.PrintHeaderTemplate](/WPF/DevExpress.Xpf.PivotGrid.PivotGridField.PrintHeaderTemplate)<br><br><br>[PivotGridField.PrintHeaderTemplateSelector](/WPF/DevExpress.Xpf.PivotGrid.PivotGridField.PrintHeaderTemplateSelector) | Specify the template that defines the presentation of the [field headers](/WPF/7993/controls-and-libraries/pivot-grid/ui-elements/field-header) when the pivot grid is printed. |
| [PivotGridControl.PrintFieldValueTemplate](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintFieldValueTemplate)<br><br><br>[PivotGridControl.PrintFieldValueTemplateSelector](/WPF/DevExpress.Xpf.PivotGrid.PivotGridControl.PrintFieldValueTemplateSelector)<br><br><br>[PivotGridField.PrintValueTemplate](/WPF/DevExpress.Xpf.PivotGrid.PivotGridField.PrintValueTemplate)<br><br><br>[PivotGridField.PrintValueTemplateSelector](/WPF/DevExpress.Xpf.PivotGrid.PivotGridField.PrintValueTemplateSelector) | Specify the template that defines the presentation of the [field values](/WPF/7995/controls-and-libraries/pivot-grid/ui-elements/field-value) when the pivot grid is printed. |

See Also

[Tutorial: Printing and Exporting a Pivot Grid](/WPF/10361/controls-and-libraries/pivot-grid/printing-and-exporting/tutorial-printing-and-exporting-a-pivot-grid)

[Export to Tabular Formats (CSV, XLS, XLSX)](/WPF/400439/controls-and-libraries/pivot-grid/printing-and-exporting/export-to-tabular-formats)

[Document Post-Processing](/WPF/404666/controls-and-libraries/data-grid/printing-and-exporting/document-post-processing)