Skip to main content

Step 4 — Print Multiple Controls

  • 2 minutes to read

The ExpressPrinting System supports two techniques that allow you to combine content from multiple sources using one print link: composition report links and container controls.

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.

Add another TListBox control to the application form as follows:

VCL Printing System: Expand an Existing Project Using Another List Box

Display a collection editor and add a print link for the new list box control:

VCL Printing System: Add a Print Link for the New List Box Control

Display a drop-down menu for the Add… button in the print link collection editor and click Add Composition… to add an empty composition print link. Alternatively, you can click Add Standard… and select an item associated with the TdxCompositionReportLink class and click OK to apply pending changes.

VCL Printing System: Add a Composition print Link

Select the created composition link and click the Show Designer… button. Add a new item to the collection editor and set the item’s ReportLink property to the print link created for the first list box control.

VCL Printing System: Associate the First Print Link with a Composition Link

Add another item to the collection and set this item’s ReportLink property to the second print link.

VCL Printing System: Associate the Second Print Link with the Same Composition Link

Close the collection editor and click the Preview… button to display the print layout that contains content from two controls on two separate pages.

VCL Printing System: The Print Preview Dialog for the Composition Print Link

To print both list box controls on the same page, select the composition print link and set the StartEachItemFromNewPage property to False using the Object Inspector.

VCL Printing System: Disable the New Page Printing Option

To print both list boxes at the same positions as on the form, add a print link for the parent form as follows:

VCL Printing System: Create a Print Link for the Application Form

Click the Show Designer… button to display the designer dialog for the created print link. Switch to the Controls tab and uncheck all items that correspond to buttons on the form to exclude them from printed content. Click OK to close the dialog and apply pending changes.

VCL Printing System: Specify Printed Controls on the Application Form

Click the Preview… button to display the Print Preview dialog. Both list boxes now occupy the same page side by side.

VCL Printing System: The Printed Page with Two List Boxes