SQL/MP Report Writer Guide

HP NonStop SQL/MP Report Writer Guide527213-001
4-1
4 Customizing a Report
You can use the report formatting commands and the layout and style options to
enhance a report. The examples in this section show you how to produce the special
effects you might want in a report. The following tasks are described:
Defining the layout by setting margins, paginating, and spacing items and lines
Organizing rows into break groups to emphasize sets and subsets of values and to
compute subtotals
Labeling information with column headings, titles, footings, line numbers, and
descriptive text
Formatting data such as numeric values, monetary values, names, dates and
times; suppressing leading and trailing zeros; truncating values; replacing blank
print positions with filler characters
Specifying the items to be used in detail lines
Printing items or line entries conditionally
Redefining special characters such as the underline and decimal point
Calculating totals and subtotals
Printing double-byte characters
Defining the Layout
You control the layout of a report by specifying margins, pagination, and spacing.
Setting Margins
The current setting of the layout options LEFT_MARGIN and RIGHT_MARGIN
determines the margins of a report.
If you want a margin to precede the leftmost printed item in your report, you must set
the left margin to the number of blanks desired. For example, when the default left
margin setting (0) is in effect, the first character of the output line is printed in print
position 1.
If you want a margin of 8 print positions (a blank report field of 8 single-byte or 4
double-byte characters), enter SET LAYOUT LEFT_MARGIN 8. The detail line output
begins in print position 9 with 8 blanks preceding each printed or displayed line.
Note. YA print position is defined in this manual as the space in the output line occupied by one single-
byte character. A double-byte character occupies two print positions. When calculating print positions for
an output line, special consideration must be given to cases where the output line can contain both
single and double-byte characters. For more information, see Printing Double-Byte Characters
on
page 4-58.