SQL/MX Report Writer Guide
Using MXCI and the Report Writer
HP NonStop SQL/MX Report Writer Guide—527194-002
2-12
Entering Report Formatting Commands
You can enter only one version of each of these commands at one time:
•
BREAK ON
•
DETAIL
•
PAGE FOOTING
•
PAGE TITLE
•
REPORT FOOTING
•
REPORT TITLE
•
TOTAL
If you enter a second version of any of these commands, that version replaces the
previous one. A report formatting command is canceled if you do any of the following:
•
Cancel the current SELECT command.
•
Enter LIST ALL.
•
Reset the command using RESET REPORT.
You can have more than one BREAK FOOTING, BREAK TITLE, or SUBTOTAL
command in effect at a time, but only one of each type of command can refer to a
specific break column defined in the BREAK ON command.
For example, suppose that you enter this BREAK ON command:
S> BREAK ON DEPTNUM, JOBCODE;
You can request a subtotal of the first column for every department number as follows:
S> SUBTOTAL COL 1 OVER DEPTNUM;
Column 1 will be subtotaled whenever the value of DEPTNUM changes.
To request a subtotal of the second column whenever the job code changes, enter:
S> SUBTOTAL COL 2 OVER JOBCODE;
If you enter another SUBTOTAL OVER command for the same break item, the
previous SUBTOTAL OVER command for that item is replaced.
For example, this SUBTOTAL command replaces the previous SUBTOTAL OVER
JOBCODE command:
S> SUBTOTAL COL 3 OVER JOBCODE;
If you enter a SUBTOTAL command without an OVER clause, the items specified will
be subtotaled whenever the value of any break item changes. This command provides
a short way of specifying SUBTOTAL OVER for all break items.
You can have only one version of a SUBTOTAL command without an OVER clause
current at one time. In the next example, the SUBTOTAL COL 1 command specifies
that column 1 will be subtotaled whenever the value of a break item changes.