SQL/MX Report Writer Guide
Customizing a Report
HP NonStop SQL/MX Report Writer Guide—527194-002
4-7
Paginating
You can specify the maximum number of pages to be printed in a report by setting the
PAGE_COUNT layout option. For example, to set the limit to 100 pages, enter:
>> SET LAYOUT PAGE_COUNT 100;
The default PAGE_COUNT value is ALL. The entire report is printed or displayed.
To number the pages in a report, use the PAGE_NUMBER function to retrieve the
number of the current page. The first page of the report is numbered 1. The report
writer maintains the page count based on the page breaks that occur, including those
page breaks generated by a PAGE clause or a NEED clause.
The report in Figure 4-3 illustrates features related to page breaks and page
numbering. The horizontal lines indicate where page breaks occur.
Tho select data for the report, enter:
>> SELECT *
+> FROM EMPLOYEE E, DEPT
+> WHERE E.DEPTNUM = DEPT.DEPTNUM
+> ORDER BY E.DEPTNUM, JOBCODE DESC ;
These commands define the report:
S> DETAIL JOBCODE,
+> EMPNUM,
+> CONCAT (LAST_NAME STRIP, ', ', FIRST_NAME)
+> AS A25 NOHEAD,
+> SALARY;
S> BREAK ON E.DEPTNUM, JOBCODE;
S> BREAK FOOTING E.DEPTNUM (PAGE) ;
S> PAGE TITLE 'Department: ', DEPTNAME ;
S> PAGE FOOTING 'Location ', LOCATION, TAB 50,
+> 'Page - ', PAGE_NUMBER AS I2;
S> SET LAYOUT PAGE_LENGTH 15;