Oracle® OLAP DML Reference 10g Release 2 (10.2) Part Number B14346-02 |
|
|
View PDF |
The PAGE command forces a page break in output when PAGING is set to YES
. An optional argument to PAGE specifies a conditional page break based on how many lines are left on the page.
The PAGE command 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.
Syntax
PAGE [n]
Arguments
A positive 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 21-19, "Keeping Lines Together".
Notes
Top of Page
No page break occurs when you are already at the top of a page when a PAGE statement is executed.
Producing the Header
The PAGE command 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.
Examples
Example 21-19 Keeping Lines Together
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 PAGE
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.
Example 21-20 Forcing a Page Break
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 PAGEPRG 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