SQL/MP Report Writer Guide

Customizing a Report
HP NonStop SQL/MP Report Writer Guide527213-001
4-10
Defining the Layout
SPACE clause
You can use the SPACE clause as a print item in a detail line, title,
or footing to insert a specified number of spaces before displaying
or printing the next item. This clause temporarily overrides the
SPACE option; the clause determines the amount of space
between the print items that precede and follow the clause. For
example, output from the following detail line has 2 spaces
between all items except the EMPNUM and LAST_NAME items:
S> DETAIL EMPNUM, SPACE 5, LAST_NAME,
+> FIRST_NAME, JOBCODE;
The SPACE clause is also useful in titles and footings. For
example, the following command generates a title with 6 spaces
between DEPTNUM and the LOCATION label:
S> PAGE TITLE "Department No. ",
+> DEPTNUM AS I4,
+> SPACE 6, "Location: ", LOCATION;
Note If you are defining a report that contains double-byte characters, see Printing
Double-Byte Characters on page 4-58 for special considerations regarding using the
SPACE clause.
TAB clause
Another way to position print items is by using the TAB clause as a
print item. You can tab to a specific print position in a detail line,
title, or footing. The position you specify is not relative to the
current left margin; it is an absolute position relative to the
available print positions on the output device. However, you must
specify a tab that is within the margins.
For example, suppose the left margin is 8 and the right margin is
80. The following command prints the Location label beginning at
print position 35. The label begins in the 27th print position to the
right of the left margin.
S> PAGE TITLE "Dept. No. ", DEPTNUM AS I4,
+> TAB 35, "Location: ", LOCATION;
Figure 4-5 illustrates the result of the preceding title command as it
appears on a terminal and a printed page.
If you change the left margin of a report, you must also change
any tab specifications to ensure that the alignment of information
does not change relative to other information in the report.
Note If you are defining a report that contains double-byte characters, see“Printing
Double-Byte Characters on page 4-58 for special considerations regarding using the TAB
clause.
AS clause
You can also control the spacing of items through the display
formats you specify in an AS clause. For more information, see
Formatting Data Values
on page 4-28.