SQL/MX Report Writer Guide
Customizing a Report
HP NonStop SQL/MX Report Writer Guide—527194-002
4-19
Multiple-Line Headings
S> LIST N 3;
Employee No. Name Job Title
------------ ------------------------- ------------------
65 RACHEL MCKAY MANAGER
87 ERIC BROWN SYSTEM ANALYST
104 DAVID STRAND SYSTEM ANALYST
S>
The previous detail line illustrates these important points:
•
If the width of a heading is greater than the width of the print item value, the
heading determines the field size. A numeric value is right-justified; a character
value is left-justified. A NULL character value is left-justified.
•
The width of the display field for a print item that is a table or view column is
determined by the default display format for the data type of the column. You can
override the default width by specifying an AS clause:
CONCAT (FIRST_NAME, SPACE 1, LAST_NAME) AS A25.
You cannot use an AS clause with columns of the INTERVAL data type. For more
information about displaying totals and subtotals on columns of the INTERVAL
data type, see Calculating Totals on page 4-49.
For more information about the AS clause and default display formats, see
Formatting Data Values on page 4-30.
•
A centered heading might not appear to be centered if the left-justified values are
followed by blanks.
Multiple-Line Headings
A report can include multiple-line headings. You indicate where the line breaks occur
by using the current new-line character. The default NEWLINE_CHAR value is a slash
(/).
These commands define a supplier parts summary that contains multiple-line
headings. The command that selects the data follows:
>> SELECT *
+> FROM SAMDBCAT.SALES.PARTS P,
+> SAMDBCAT.INVENT.PARTSUPP PS,
+> SAMDBCAT.INVENT.SUPPLIER S,
+> WHERE P.PARTNUM = PS.PARTNUM AND PS.SUPPNUM = S.SUPPNUM
+> ORDER BY S.SUPPNUM, P.PARTNUM;
To define the detail line and display the first row of output, enter:
S> DETAIL P.PARTNUM HEADING 'Part/Number' CENTER,
+> QTY_AVAILABLE HEADING 'Available/Units' CENTER,
+> PARTCOST HEADING 'Unit Cost/(dollars)' CENTER,