SQL/MP Report Writer Guide
Table Of Contents
- What’s New in This Manual
- About This Manual
- 1 Introduction to the NonStop SQL/MP Report Writer
- 2 Using SQLCI and the Report Writer
- 3 Selecting Data for a Report
- 4 Customizing a Report
- Defining the Layout
- Specifying the Items in a Detail Line
- Naming Select List and Detail Line Items
- Organizing Rows Into Break Groups
- Labeling Information
- Formatting Data Values
- Formatting Dates and Times
- Using TACL to Pass Parameters
- Conditional Printing of Items or Line Entries
- Redefining Special Characters
- Calculating Totals
- Calculating Subtotals
- Printing Double-Byte Characters
- A Comparison of the Report Writer and the Enform Language
- Index

Customizing a Report
HP NonStop SQL/MP Report Writer Guide—527213-001
4-56
Calculating Subtotals
+> OD.ORDERNUM,
+> PARTNUM,
+> UNIT_PRICE AS F8.2 HEADING "PRICE",
+> QTY_ORDERED AS I8 HEADING "QUANTITY",
+> UNIT_PRICE * QTY_ORDERED AS F14.2
+> HEADING "TOTAL PRICE" NAME TOTALP ;
S> BREAK ON CUSTNUM, OD.ORDERNUM;
S> SUBTOTAL QTY_ORDERED, TOTALP OVER OD.ORDERNUM;
S> SUBTOTAL TOTALP OVER CUSTNUM;
S> LIST ALL;
Calculating Subtotals on Conditional Values
The value in a column specified by using an IF/THEN/ELSE clause is in character
format and cannot be subtotaled or totaled by using the SUBTOTAL or TOTAL
Figure 4-22. Customer Orders Summary
700510143 4000.00255 4 16000.00
9195.00
* * *
34 9195.00
* * *
123 200490
* * *
5505
3210
350.00
715.00
1
1 715.00
350.00
2 1065.00
300380
2405
2402
244
3000.00
320.00
760.00 8
12
16
18000.00
3840.00
6080.00
* * *
36 27920.00
* * *
28985.00
.
.
.
.
.
.
.
.
.
.
.
.
21 200320 5504 165.00 5 825.00
6400
6301
6201
540.00
245.00
195.00
7
6
16
3780.00
1470.00
3120.00
CUSTNUM
ORDERNUM PARTNUM
PRICE QUANTITY
TOTAL PRICE
VST0422.vsd