|Oracle® OLAP DML Reference
10g Release 1 (10.1)
Part Number B10339-02
The FILEPAGE command forces a page break in your output when PAGING is on. FILEPAGE can send the page break conditionally, depending on how many lines are left on the current page
FILEPAGE fileunit [n]
A positive integer expression that indicates a page break should occur when there are fewer than n lines left on the page. When the number of lines left equals or exceeds n, or n equals zero, no page break occurs. When n is greater than PAGESIZE, a page break occurs when LINENUM is not zero. When n is negative or omitted, a page break always occurs.
Oracle OLAP calculates the number of available lines left on the page using the values of the options that specify the page size, the current line number, and the bottom margin. The number, which is stored in LINESLEFT, is calculated according to the following formula.
LINESLEFT = PAGESIZE - LINENUM - BMARGIN
The PAGE command has the same effect as specifying the FILEPAGE command for the fileunit number OUTFILEUNIT, which is the number of the current outfile destination. The following two statements are equivalent.
FILEPAGE OUTFILEUNIT PAGE
Example 13-4 Using the FILEPAGE Command
In the following program fragment, you might send a FILEPAGE command when you know the next group of products will not fit on the page. The program takes as arguments the name of the output file, and three
month dimension values.
fil.unit = FILEOPEN(ARG(1) WRITE) LIMIT month TO &ARG(2) &ARG(3) &ARG(4) COMMAS = NO DECIMALS = 0 FOR district DO FILEPAGE fil.unit STATLEN(product) FOR product DO FIL.TEXT = product FOR month JOINCHARS(fil.text ' ' CONVERT(sales TEXT)) FILEPUT fil.unit fil.text DOEND FILEPUT fil.unit '' DOEND FILECLOSE fil.unit