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).
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.
Private Sub Button1_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) _
String DocumentName="Preview Document"
String Title="Print Preview"
PivotGridControl1.ShowPrintPreview(Me, DocumentName, Title)
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.
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.