$page
Return the current page number in a Report or Form while printing.
$page
Example: if ($page != 1)
...
Return Values
Value |
Meaning |
---|---|
0 | Uniface is not printing (that is, $printing is 0) |
>0 | Number of the page currently being printed. |
Use
Use in Form and Report components.
Description
You can use $page to assign the page number to fields in header or footer frames.
If you are not printing, it returns zero when used in the getFocus trigger of a header or footer frame.
Using $page
The ProcScript in the following example assigns the page number to the dummy field REPORTPAGE in the footer frame. The footer frame has the Suppress Print if Empty property selected, which means that it does not appear if REPORTPAGE has no value.
The first page of the report is a cover sheet that is not numbered; subsequent pages are numbered starting at 1. Because of the unnumbered page, the value of REPORTPAGE is one less than the value supplied by $page.
trigger getFocus ; of footer frame if ($page = 1) ;if on first page done ;take no action done else REPORTPAGE = $page - 1 endif end