Step 3 - Customizing the Printed Page
- 3 minutes to read
The previous step demonstrated how to customize the appearance of printed controls. This topic provides a brief overview of methods that can be used to customize margins, header and footer content, and report layout within report pages. Note that the topic assumes that you’ve successfully completed the previous two steps in this Quick Start guide before proceeding.
Follow the steps below:
- Invoke the report link collection editor, the single report link created in the first step will be available. Click the link to select it, click the Page Setup… button which will invoke the page setup dialog.
- Switch to the Margins page and increase the left margin by dragging it with the mouse.
Note that this page also allows you to center the report within the printed page. Use the check boxes at the page’s bottom edge for this purpose.
- Switch to the Header\Footer page, this page enables you to customize the header and footer content. You can use a number of reserved character sequences that will be replaced with service information when printing. Such character sequences can be used to display the current time, page number, etc.; you can enter these using the buttons located within the Predefined Functions group box. You can also type in any static text you need. The image below shows the Header\Footer page with the customized header content.
- Click the Background button which corresponds to page headers. This will invoke a popup window allowing you to choose a fill color, reset the color to transparent or specify a custom filling (pattern or image). Select the light green color.
Note that choosing the Fill Effects… option invokes the Fill Effects dialog which will be mentioned later.
- Click the OK button to close the page setup dialog saving the changes made.
- Click the button which corresponds to the link’s PrintedPage.Background property. This will invoke the Fill Effects dialog, used to specify how the printed page’s background will be filled. Select the White Marble texture and click the OK button to close the dialog saving the changes made.
- Run the application and click the Print the ListBox button to invoke the print preview window. The image below shows the report’s appearance after the printed page has been customized.
- Note that you can also invoke the Page Setup and Fill Effects dialogs at runtime. Add two more buttons to the form, set their captions to ‘Page Setup‘ and ‘Fill Effects‘ and write the following handlers for their OnClick events.
procedure TForm1.Button3Click(Sender: TObject);
begin
listBoxReportLink.PageSetup;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
listBoxReportLink.PrinterPage.Background.SetupEffects;
end;
- Run the application and try using the buttons created.
Note
End-users can also invoke both these dialogs at runtime, using the Page Setup and Background toolbar buttons within the print preview window or alternatively they can use the File | Page Setup… and Format | Background… menu items respectively.
The next step demonstrates how to print multiple controls simultaneously.