Skip to main content

How to Display Print Preview and Print the Tree List

The following code snippet demonstrates how to create a report link for the TreeList 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.

uses
//...
  ..., dxPScxTL5Lnk;
//...
var
  ATreeListReportLink: TBasedxReportLink;
begin
  // Creates a report link for the TreeList control and adds it to a component printer
  ATreeListReportLink := dxComponentPrinter1.AddLink(TreeListControl);
  // Invokes the print preview window
  dxComponentPrinter1.Preview(True, ATreeListReportLink);
end;

The result is shown in the image below.

See Also