Syntax
BEGINPAGE { CLEAR | frame_name} [ AS outputstream ]
Parameters
BeginPage can be abbreviated as BP.
CLEAR
Resets all heading definitions.
frame_name
The heading frame.
AS outputstream
Restricts the effect of this command to the specified outputstream.
Description
The BeginPage logic command specifies the heading frame at the top of each new page of a report. However, it does not generate a new page when it occurs.
Note: The EndNoPrint logic command should not be included in a frame designated by a BeginPage logic statement.
If several frames are required as headings, use multiple BeginPage logic statements to specify the required frames. The frames are printed at the top of all subsequent pages in numerical frame sequence order, rather than the order in which they are specified.
The logic of the heading frame is executed after the logic of the frame currently being printed, during the printing of the frame.
The BeginPage logic command is regarded as part of the page heading referred to by the line parameter of the Print method.
BeginPage Clear
The BeginPage Clear logic command variant resets all heading definitions. It also advances to a new page when the next frame is printed. For DEPCON reports, the BeginPage Clear logic command variant writes a $NEWPAGE$ command to the output file.
Note: When a BeginPage Clear logic command variant is executed, the Glb.LineCount built-in segment attribute is set to 9999 to force the new page. Since the logic of the print frame is executed before the advance to new page occurs, the Glb.LineCount built-in segment attribute value is 9999, not 0.
ROC reports
An Advance NewPage logic command statement specified within a heading causes the heading to continue on the next page without restarting the heading. Use the EndNoPrint logic command to suppress output.
The length of the heading is unlimited.
Note: If the Glb.FormDepth built-in segment attribute is set to zero, headings are not printed. In this case, invoke the Print method to print the required headings.
Non-ROC reports
During the definition of headings, the following might result in the creation of an infinite loop, and should be avoided:
An Advance NewPage logic statement variant included within a heading.
An EndNoPrint logic statement included within a heading.
A heading whose length equals or exceeds the value of the Glb.FormDepth built-in segment attribute.
Example
In this example, a report has the following frames:
Frame01 has a "Listing of Deposits" label
Frame02 has a "Listing of Withdrawals" label
Frame03 has "Customer" and "Amount" labels
Frame04 has Customer and Amount attributes
The report includes the following logic:
BeginPage Frame01 : Print "Listing of Deposits" (Frame01) BeginPage Frame03 : Print "Customer" and "Amount" (Frame03) Determine Actual Event.Deposits : Retrieve information from the database Frame04.Print() : Print Frame04 End BeginPage Clear : Resets the heading BeginPage Frame02 : Specify Frame02 BeginPage Frame03 : Specify Frame03 Determine Actual Event.Withdraws : Retrieve information Frame04.Print() : Print Frame04 End