Back to Devexpress

How to Display Print Preview and Print the Pivot Grid

vcl-157013-expresspivotgrid-concepts-how-to-display-print-preview-and-print-the-pivot-grid.md

latest1.2 KB
Original Source

How to Display Print Preview and Print the Pivot Grid

  • Jul 29, 2024

The following code snippet demonstrates how to create a report link for the pivot grid control and display the print preview window by using a TdxComponentPrinter component. This component is shipped with the ExpressPrinting System which is a separate product.

delphi
var
  APivotGridReportLink: TBasedxReportLink;
begin
  // Creates a report link for the pivot grid control and adds it to a component printer.
  APivotGridReportLink := dxComponentPrinter1.AddLink(PivotGridControl);
  // Invokes the print preview window.
  dxComponentPrinter1.Preview(True, APivotGridReportLink);
end;
cpp
// Creates a report link for the pivot grid control and adds it to a component printer.
  TBasedxReportLink *APivotGridReportLink = dxComponentPrinter1->AddLink(PivotGridControl);
  // Invokes the print preview window.
  dxComponentPrinter1->Preview(True, APivotGridReportLink);

The result is shown in the image below.