x
Syntax: How to Insert a Page Break
{ON|BY} fieldname PAGE-BREAK [REPAGE] [WHEN expression;]
where:
- ON|BY
Is a vertical sort phrase. The terms are synonymous.
- fieldname
Is the sort field on which the page break occurs. Specify
the lowest level sort field at which the page break occurs. A page
break occurs automatically whenever a higher level sort field changes.
- REPAGE
Resets the page number to 1 at each page break or, if combined
with WHEN, whenever the WHEN criteria are met.
- WHEN expression
Specifies a conditional page break in the printing of a report
as determined by a logical expression. See Controlling Report Formatting for details.
Example: Inserting a Page Break
This request generates a new page whenever
the value of the sort field SALARY changes.
TABLE FILE EMPLOYEE
PRINT EMP_ID
BY SALARY IN-GROUPS-OF 5000
BY PCT_INC BY DAT_INC
ON SALARY PAGE-BREAK
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET PAGE-NUM OFF
END
The first two pages of
the report are displayed to illustrate where the page breaks occur:
The second page is:
Example: Displaying a Multiple-Table HTML Report
In this request, each page is returned
to the browser as a separate HTML table. SQUEEZE is set to OFF for
consistent alignment of tables across pages.
SET STYLEMODE = PAGED
SET LINES = 12
TABLE FILE CENTORD
HEADING
"SALES OVER $200,000"
PRINT LINEPRICE AS 'Sales'
BY SNAME BY ORDER_NUM
WHERE LINEPRICE GT 200000
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, SQUEEZE=OFF, $
ENDSTYLE
END
Two pages of the report
follow, showing consistent alignment:
The same two pages illustrate inconsistent
alignment with SQUEEZE set to ON: