PrintInfo Reference > PrintInfo Properties > PageFooter Property (PrintInfo) |
This property sets or returns a string to be printed at the bottom of each page.
PrintInfo.PageFooter= string
Read/Write at run time and design time.
By default, this property returns an empty string, and no page footer is printed.
If specified, the page footer can consist of up to three substrings separated by the \t character sequence. The first substring will be left-aligned, the second centered, and the third right-aligned on the printed page. The \p sequence will be replaced by the current page number during printing.
For example, the following statement sets the PageFooter property of the default PrintInfo object so that the word "CONFIDENTIAL" is centered at the bottom of each page:
TDBGrid1.PrintInfo.PageFooter = "\tCONFIDENTIAL"
In addition, the following characters provide even greater control over the appearance of the PageFooter property, especially when the grid is so large that columns span more than one printed page.
\p |
Current page number. 1-based, and incremented by subpages (that is, the group of pages that hold all of the columns for a set of records). |
\P |
Total number of pages; each sub-page is counted separately. |
\g |
Current subpage group number. 1-based. |
\G |
Total number of subpage groups |
\s |
Current subpage number. 1-based. |
\S |
Total number of subpages. |
For example, the following statement sets the PageFooter property of the default PrintInfo object so that the number of groups is on the left, the sub-page number is in the center, and the total number of pages is on the right, preceded by the word "Page:"
TDBGrid1.PrintInfo.PageFooter = _
"\tPage: \g of group \G, \s of subpage \S, \p of page \P"
The page footer will look something like this:
Page: 1 of group 169, 1 of subpage 2, 1 of page 338
Note
If Draft mode is True, the total pages and subpage group pages will not be calculated.
Use the PageHeader property to specify a string to be printed at the top of each page.