.Newpage Statement--Insert Page Break
The .newpage statement causes an immediate page break, with an optional change in the page number.
This statement has the following format:
.newpage | .np [[+|-] pagenumber | expression]
The parameters for the .newpage statement are as follows:
+ | -
If a sign is present, the new position is calculated relative to the current position. If no sign is present, it is set to the specified value.
. The plus sign (+) or minus sign (-) must be stated explicitly and cannot be a part of the expression.
pagenumber
The page number to be assigned to the next page in the report.
expression
A numeric expression that evaluates to the page number to be assigned as the next page in the report. All variables that are part of the expression must be preceded by a dollar sign ($).
Description
You can place the .newpage statement at any point in your report specification. Report-Writer performs an immediate page break by skipping enough lines to get to the end of the page, then prints the page footer, sets the new page number, and writes a page header at the top of the new page. Report-Writer determines the new page number by incrementing the old page number, or by setting, incrementing, or decrementing the old page number to the specified value. If pagenumber is not specified, Report-Writer determines the default page number by incrementing the current page number by one.
At the end of the report, Report-Writer performs a .newpage statement automatically, if a page footer is specified (in this case, no page header appears on the next page). Also, if Report-Writer encounters a .newpage statement as the first printing action of the report, it does not print a page footer for that page.
Report-Writer evaluates any expressions used as parameters to the .newpage statement during runtime.
Examples
1. Skip to a new page, incrementing the current page number by 1.
.newpage
2. Reset the page number to 22.
.newpage 22
3. Reset the page number to the current page plus the value of skip_page.
.newpage +$skip_page
Last modified date: 08/14/2024