[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Binding to Data
   [Expand]Data Shaping
   [Expand]Data Analysis
   [Expand]Layout
   [Collapse]Printing and Exporting
     Export to Tabular Formats (CSV, XLS, XLSX)
     Tutorial: Printing and Exporting a Pivot Grid
   [Expand]End-User Interaction
   [Expand]Appearance
   [Expand]MVVM Enhancements
   [Expand]UI Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[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]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Printing and Exporting

Expanded Printing and Exporting Basics

The 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.v18.2 assembly. Otherwise, data printing and exporting are not allowed.

To preview the pivot grid, use the PivotGridControl.ShowPrintPreview and PivotGridControl.ShowPrintPreviewDialog methods. 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 Exports the pivot grid to the specified stream or file path in CSV format.
PivotGridControl.ExportToHtml Exports the pivot grid to the specified stream or file path in HTML format.
PivotGridControl.ExportToImage Exports the pivot grid to the specified stream or file path in image format.
PivotGridControl.ExportToMht Exports the pivot grid to the specified stream or file path in MHT format.
PivotGridControl.ExportToPdf Exports the pivot grid to the specified stream or file path in PDF format.
PivotGridControl.ExportToText Exports the pivot grid to the specified stream or file path in text format.
PivotGridControl.ExportToXls Exports the pivot grid to the specified stream or file path in XLS format.
PivotGridControl.ExportToXlsx Exports the pivot grid to the specified stream or file path in XLSX format.
PivotGridControl.ExportToXps Exports the pivot grid to the specified stream or file path in XPS format.

Expanded 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) document.

Expanded 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 Gets or sets whether to print headers of the column fields. This is a dependency property.
PivotGridControl.PrintDataHeaders Gets or sets whether to print headers of the data fields. This is a dependency property.
PivotGridControl.PrintFilterHeaders Gets or sets whether to print headers of the filter fields. This is a dependency property.
PivotGridControl.PrintHeadersOnEveryPage Gets or sets whether to print field headers on every page. This is a dependency property.
PivotGridControl.PrintHorzLines

Gets or sets whether the horizontal grid lines are printed. This is a dependency property.

PivotGridControl.PrintInsertPageBreaks Gets or sets whether to insert page breaks at the end of every page. This is a dependency property.
PivotGridControl.PrintLayoutMode Gets or sets the layout mode of the print document. This is a dependency property.
PivotGridControl.PrintRowHeaders Gets or sets whether to print headers of the row fields. This is a dependency property.
PivotGridControl.PrintUnusedFilterFields Gets or sets whether to print headers of the unused filter fields. This is a dependency property.
PivotGridControl.PrintVertLines

Gets or sets whether the vertical grid lines are printed. This is a dependency property.

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

Property

Description

PivotGridControl.PrintFieldCellTemplate

PivotGridControl.PrintFieldCellTemplateSelector

PivotGridControl.PrintFieldCellKpiTemplate

PivotGridControl.PrintFieldCellKpiTemplateSelector

PivotGridField.PrintCellTemplate

PivotGridField.PrintCellTemplateSelector

Specify the template that defines the presentation of the data cells when the pivot grid is printed.

PivotGridControl.PrintFieldHeaderTemplate

PivotGridControl.PrintFieldHeaderTemplateSelector

PivotGridField.PrintHeaderTemplate

PivotGridField.PrintHeaderTemplateSelector

Specify the template that defines the presentation of the field headers when the pivot grid is printed.

PivotGridControl.PrintFieldValueTemplate

PivotGridControl.PrintFieldValueTemplateSelector

PivotGridField.PrintValueTemplate

PivotGridField.PrintValueTemplateSelector

Specify the template that defines the presentation of the field values when the pivot grid is printed.

Expanded See Also

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