Create a Customized Print Preview Form

1 Close the application and return to the Delphi development environment.

2 Select File | Open from the Delphi main menu. Locate the ppPrvDlg unit in the RBuilder\Source directory. Open this unit.

3 In the Object Inspector, change the form name from ppPrintPreview to rbPrintPreview. (You may have to use the drop-down list box at the top of the Object Inspector to find the ppPrintPreview form).

4 Save the form in the My RB Tutorials directory under the name rbPrvDlg.

5 Select the panel at the top of the form (named pnlPreviewBar).

6 Set the color to clAqua.

7 Bring the Code Editor to the front and scroll to the very bottom of the unit and check the initialization section of the unit. The code should look like this:

initialization ppRegisterForm(TppCustomPreviewer, 0>TrbPrintPreview);

finalization ppUnRegisterForm(TppCustomPreviewer); end.

This register call replaces the built-in ReportBuilder Print Preview form with this custom version. The initialization section fires when the unit is loaded. The unit is loaded only if it appears in the uses clause of another unit or is included in the project. For this reason, you should always add your preview form to your project or add the form's unit name to the uses clause of your application's main unit.

8 Select File | Save from the Delphi main menu.

9 Close the Code Editor.

Was this article helpful?

0 0
Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment