SQL/MX Report Writer Guide
Customizing a Report
HP NonStop SQL/MX Report Writer Guide—527194-002
4-28
Line Numbers
The line number is incremented at each detail line. If the detail line is printed as
multiple output lines, the number is incremented only once for each set of output lines.
The default display format for the LINE_NUMBER value is I11. To number all detail
lines in one sequence, include the print item:
LINE_NUMBER OVER REPORT
or
LINE_NUMBER
Suppose that you want to number the entries in a listing of parts and the suppliers who
supply them. The numbering sequence is to be restarted at each new page. To
produce the list, enter:
>> SELECT * FROM SUPPLIER, PARTSUPP
+> WHERE SUPPLIER.SUPPNUM = PARTSUPP.SUPPNUM
+> ORDER BY PARTNUM, SUPPLIER.SUPPNUM ;
S> SET STYLE HEADINGS OFF;
S> DETAIL LINE_NUMBER OVER PAGE AS I4,
+> TAB 7,
+> 'Part Cost',
+> PARTCOST ,
+> SKIP 1,
+> TAB 7,
+> 'Supplier',
+> SUPPLIER.SUPPNUM,
+> SUPPNAME;
S> BREAK ON PARTNUM;
S> BREAK TITLE PARTNUM ('Part ', PARTNUM);
S> TITLE 'Parts Supplier List', TAB 48,
+> 'Page ', PAGE_NUMBER AS I3;
S> LIST NEXT 5;
Figure 4-13 shows the report.