[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
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Binding to Data
   [Expand]Data Shaping
   [Expand]Data Analysis
   [Collapse]Printing and Exporting
     Export to Tabular Formats (CSV, XLS, XLSX)
     Tutorial: Printing and Exporting a Pivot Grid
   [Expand]End-User Interaction
   [Expand]MVVM Enhancements
   [Expand]UI Elements
   [Expand]End-User Capabilities
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [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
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Tutorial: Printing and Exporting a Pivot Grid

This document acquaints you with the printing and exporting capabilities provided by DXPivotGrid.

In this lesson, use the application you have created in Lesson 1.

This tutorial will guide you through the following steps:

Expanded Step 1. Customize Print Options

First, let's take a look at the PivotGridControl print options. You can find them in the Print Options section of the Properties window.

Here you can access multiple settings that allow you to customize a printing report to be generated out of the pivot grid. For instance, you can specify which visual elements (like field headers and grid lines) should be printed and whether to use a single-page or a multiple-pages layout mode (see PivotGridControl.PrintLayoutMode for details).

Expanded Step 2. Show Print Preview

To see the pivot grid printing capabilities in action, add a standard button to your WPF application and set the button caption to Print Preview.

To invoke a pivot grid Print Preview, call the PivotGridControl.ShowPrintPreview method in the button click event handler.

Now run the project and click Print Preview to see the print report.

You can navigate through report pages by clicking the Next Page button on a navigation bar.

To print this report using a local printer, use the Print toolbar button.

Expanded Step 3. Customize Export Options

You can also use the Print Preview dialog to export pivot grid data into numerous popular formats. To do this, use the Export Document button. Click the button's down arrow to display a drop-down menu that allows you to choose a required file format.

After you select a format, an export options window will be invoked allowing you to customize format-specific settings. For example, for HTML you can specify whether to export a report into a single HTML file without breaking it into pages (Single file export mode), preserve a page-by-page breakdown in the resultant file (Single file page-by-page export mode), or generate individual HTML files for each page of the report (Different files export mode).

If you choose to create individual HTML files for each page or preserve page-by-page breakdown while exporting to a single file, you will be able to specify page settings like the color and width of page borders.

Similarly to HTML, if you select a simple format (e.g. CSV), you will be able to access its specific options like text encoding and export mode.

Now click OK and choose the destination where the file should be saved using a standard file save dialog.

Expanded See Also

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