HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4-: 61
one such statement.
Syntax
[{,} ]
GRAND TOTALS [ON]
num_expr
[{;}
num_expr
]...
Parameters
num_expr
Any numeric expression can be totaled. There can be as
many expressions as desired. When referring to a
particular total, a
sequence
number is used. The first
expression is sequence number 1, the second is number 2,
and so on.
Examples
100 GRAND TOTALS Sales, Commission, Quantity
The BEGIN REPORT statement makes the GRAND TOTALS statement busy and it
remains busy until an END REPORT or STOP REPORT statement executes. The
GRAND TOTALS statement is used ONLY if contained in a HEADER or TRAILER
section with a nonzero level number. BEGIN REPORT sets all accumulated
totals to zero.
The GRAND TOTALS calculation occurs when a DETAIL LINE statement
executes, but only when the
totals flag
of the DETAIL LINE is nonzero.
The accumulated values are reset to zero for any summary level where a
break occurs. This is done after the TRAILER sections print. After all
break conditions are processed, the totals accumulate.
TOTALS statements are evaluated starting with GRAND TOTALS and working to
level nine. For each statement, the expressions are evaluated from left
to right.
All totals are stored in either REAL or DECIMAL data type, depending on
the data type option in effect when the report started. However, the
expressions themselves are evaluated like any other expression in HP
Business BASIC/XL. This means that an individual expression can cause an
overflow error without causing an overflow in the total.
HEADER
The HEADER statement allows you to define logical levels for separating
and summarizing data printed in a report. The HEADER section is used to
print headings for a particular level in the report. There are nine
levels available.
In order to define a report level, there must be a HEADER or TRAILER
statement in the report description. However, there can not be more than
one HEADER section for a single level within the report description. If
a WITH or USING clause is not present, the statement does not produce
output. However, other statements in this section can produce output.
Syntax
[ [LINES]]
HEADER
level_number
[WITH
num_lines
[LINE ]]
[USING
image
[;
output_list
]]
Parameters
level_number
A numeric expression in the range [0, 9]. This defines
the
summary
or
break
level for this header section.
This number creates different summary levels for data,
and causes breaks in the report at appropriate times. A
level of zero causes the entire section to be ignored.