SQL/MX Report Writer Guide

Customizing a Report
HP NonStop SQL/MX Report Writer Guide527194-002
4-8
Paginating
Use the NEED clause is when you want to keep a set of lines together, such as a
complete address. In the next example, a page break will not occur in the middle of
information about a single supplier:
>> SELECT * FROM SUPPLIER
+> ORDER BY SUPPNAME;
S> DETAIL NEED 4, 'Supplier No.', SUPPNUM NOHEAD, SKIP 1,
+> SUPPNAME NOHEAD, SKIP 1,
+> STREET NOHEAD, SKIP 1,
+> CONCAT (CITY STRIP, ', ', STATE STRIP,
+> SPACE 1, POSTCODE) NOHEAD,
+> SKIP 1 ;
S> SET LAYOUT PAGE_LENGTH 14;
S> LIST FIRST 4;
Figure 4-4 shows the first 4 rows of output. The column of numbers on the right
indicates the 14 lines on each page. These numbers do not appear in the report.
The third detail line appears on the second page because only 3 more lines are
available on the first page.
Figure 4-3. Pagination Features
JOBCODE EMPNUM SALARY
Department : FINANCE
900
500
100
208
202
210
214
23
CRAMER, SUE
CLARK, LARRY
BARTON, RICHARD
KELLY, JULIA
HOWARD, JERRY
Location CHICAGO Page - 1
Department : INVENTORY
JOBCODE EMPNUM SALARY
321
219
233
230
32
WINN, BILL
TERRY, DAVID
MCDONALD, TED
LEWIS, ROCKY
RUDOLF, THOMAS
900
250
100
200
19000.00
25000.75
29000.00
50000.00
137000.10
32000.00
27000.12
29000.00
24000.00
138000.40
Location LOS ANGELES Page - 2
Department : . . .
.
.
.
.
.
.
VST0403.vsd