The PAGE program is commonly used in report programs. It is meaningful only when PAGING is set to
YES and only for output from statements such as REPORT and LISTNAMES.
INTEGER expression that indicates that a page break should occur only when there are fewer than n lines left on the current page. When the number of lines left equals or exceeds n, no page break occurs. See Example 10-71, "Keeping Lines Together".
No page break occurs when you are already at the top of a page when a PAGE statement is executed.
The PAGE program signals that further output should be produced on a new page, but it does not produce a header on the new page unless there is further output. When there is further output, Oracle OLAP produces the heading that is defined by the current PAGEPRG program and then starts producing the output.
Suppose you have 12 lines of data that would be hard to read when interrupted by a page break, so you want to prevent such an interruption. Use the
12 statement immediately before the statements that produce the 12 lines of data. A page break will occur before the 12 lines of data only when there are less than 12 lines left on the page. When there are 12 lines or more left at that point, output will continue on the same page.
The following lines from a report program force a page break at the start of each loop for
district. This makes the report for each district start at the top of a page. (The report program uses a heading program called
report.head to create a customized heading. See the PAGEPRG option for information on customized heading programs.)
PUSH PAGING PAGEPRG PAGING = YES PAGEPRG = 'report.head' FOR district DO PAGE ROW district BLANK FOR month ROW WIDTH 8 month sales sales.plan DOEND PAGE POP PAGING PAGEPRG