Skip to main content

Step 2 — Arrange Print Controls & Document Structure Using a Wizard

  • 4 minutes to read

This topic outlines general customization capabilities available for most print links using the project created at the previous step (Control Printing Basics).

Tip

The core print-related APIs are designed for simple document generation scenarios and print/content export operations available for the majority of DevExpress VCL Controls (shipped as part of ExpressQuantum Pack, VCL Subscription, and VCL Subscription+).

For most advanced report generation and BI/data analytics usage scenarios, we recommend that you use our ExpressReports and ExpressDashboards Suites (available as part of the VCL Subscription +). These advanced solutions include both the powerful report generator and customizable print preview, BI dashboard designer and viewer for data analytics (available both at design- and runtime), smart/AI functions, non-GUI/service-based document generation, and much more.

VCL Printing System: Display the Designer Dialog at Runtime

Display the Designer Dialog

Right-click the TdxComponentPrinter component and choose the Report Links… item to display a collection editor that contains the print link created at the previous step.

VCL Printing System: Display the Print Link Collection Editor

Select the print link and click the Show Designer… button to display the designer dialog.

VCL Printing System: The List Box Print Link Designer

The dialog groups available customization options into corresponding tabs (Options, Colors, Fonts, Behaviors). In addition, the dialog displays a preview pane where you can evaluate the pending changes.

Design Time Options

Restore Defaults and Restore Original buttons are available only at design time:

Restore Defaults
Resets all options to defaults.
Restore Original
Copies print-related settings from the source control. For example, the Restore Original button assigns TListBox control’s font settings to the print link and changes the background color to white.

Configure the Print Layout at Runtime

Run the application and click the Print the ListBox button to display the Print Preview dialog for the TListBox control. Click the Design Report button within the toolbar or choose the File | Design… menu item to display the designer dialog for the print link.

VCL Printing System: The Print Link Designer Dialog at Runtime

The runtime dialog version displays Title Properties… and Footnote Properties… buttons instead of Restore Defaults and Restore Original buttons available at design time.

Click the Title Properties… button to display the Report Title dialog to display a title for the generated document layout and customize related settings. For example, you can print a title at the first page only or repeat the title at the top of every document page (Mode).

VCL Printing System: The Title Properties Dialog

Input ListBox Title within the memo editor and switch to the Properties tab.

VCL Printing System: Specify a Title

Select Left in the Horizontally combo box of the Alignment section and click OK to close the dialog and apply pending changes.

VCL Printing System: Change Title Alignment

Click OK in the designer dialog to review the updated print layout in the Print Preview dialog. The specified title is aligned to the left border of the print layout.

VCL Printing System: The Updated Print Layout for the List Box

Close the application.

Display the Designer Dialog at Runtime

Add a new button to the form, set the button’s caption to ‘Design Report‘ and write the following handler for the button’s OnClick event.

uses
  dxPSCore,    // Declares the TdxComponentPrinter component and related types
  dxPSLbxLnk,  // Declares the TdxListBoxReportLink component
  cxButtons;   // Declares the TcxButton component
// ...

procedure TMyForm.DisplayDesignerButtonClick(Sender: TObject);
begin
  dxListBoxReportLink1.DesignReport;
end;

Run the application to test the new button.

VCL Printing System: Display the Designer Dialog at Runtime

Tip

Alternatively, you can select a print link using the collection editor of the TdxComponentPrinter to customize the same settings using the Object Inspector. For example, title settings are accessible through the print link’s ReportTitle property.

Next Step

The next step demonstrates page customization using the built-in UI.