| Reports / Report operators | |
Contains the current page number in a report.
PAGENO
This operator takes no operand but returns the number of the page the report engine is currently printing.
You can use PAGENO in the PAGE HEADER or PAGE TRAILER block, or in other control blocks to number the pages of a report sequentially.
FIRST PAGE HEADER
SELECT COUNT(*) INTO cnt FROM customer
LET y = cnt/50 -- Assumes 50 records per page
ON EVERY ROW
PRINT COLUMN 10, r.customer_num, ...
PAGE TRAILER
PRINT PAGE PAGENO USING "<<" OF cnt USING "<<"
Page 1 of 20
Page 20 of 20