Page titles are header and footer strings (or similar) that can be presented in the default setup form and subsequently utilised in the report being generated. How the strings are used is at your discretion.
VPE+ manages some basic page titles automatically (system page titles), but you can define and use your own custom page titles if you wish. When the system page titles are included in the setup form, it looks like this:
System Page Titles
The system page titles include a page header, subheader and footer string.
These strings can be set as properties of the ReportWriter component in the Object Inspector, or set in code. ReportWriter also maintains additional footer detail properties which are not represented in the default setup form: see properties PageFooterStamp, PageFooterStampDated and PageFooterStamped which enable a "stamp string" to be included in the page footer.
Property | Usage |
---|---|
PageHeaderTitle | a page header title string |
PageHeaderSubTitle | a page header subtitle string |
PageFooterTitle | a page footer title string |
If you do use the system page titles, there are a number of properties available to control their usage (either in code or in the Object Inspector):
Boolean Property | Action in Setup Form |
---|---|
UsePageTitles | shows or hides the Report Title Panel |
UsePageHeaderTitle | shows or hides the page header title edit component |
UsePageHeaderSubTitle | shows or hides the page header subtitle edit component |
UsePageFooterTitle | shows or hides the page footer title edit component |
EnablePageHeaderTitle | enables or disables the page header title edit component |
EnablePageHeaderSubTitle | enables or disables the page header subtitle edit component |
EnablePageFooterTitle | enables or disables the page footer title edit component |
NOTE: Being able to set both the visibility and enablement of the page title strings allows you, for example, to display a pre-set value in a title edit control, but have it disabled (read-only).
Custom Page Titles
To supply your own page title edit components to the setup form, lay out the relevant components in a TGroupBox container on the form, and assign any code as required. Make the groupbox invisible if it will otherwise interfere with the forms display. Assign your groupbox to property ReportWriter.ReportTitleGroupBox (this will override the system page title groupbox)…
…and that is all that is required.
Internally, when the setup form instance is created for the report, it will temporarily parent the groupbox, make it visible, and, within reasonable limits, adjust its own size to accommodate the size of the groupbox. This means the components you created on your form are transferred to and displayed on the setup form, and any associated code is operational in the context of the setup form.
This screen shot shows a custom page title groupbox in the setup form:
Note that you can include your own usage options like the check box "Use 3rd Header" above - the values stored by such components remain entirely available to your report writing code.