PAGE

The PAGE program 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 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.

Syntax

PAGE [n]

Parameters

n

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 10-70, "Keeping Lines Together".

Usage 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 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.

Examples

Example 10-70 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 occurs 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 continues on the same page.

Example 10-71 Forcing a Page Break

The following lines from a report program force a page break at the start of each loop for district which 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