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-33
Formatting Data Values
If you calculate any totals or subtotals, the mask must accommodate the resulting
values. If the previous query is modified to calculate the sum of salaries for each job
code within each department and to produce subtotals and totals, the mask must be
modified to accommodate larger numbers in the detail line, and large numbers in the
subtotal and total lines.
>> SELECT DEPTNUM, JOBCODE, SUM(SALARY)
+> FROM PERSNL.EMPLOYEE
+> ORDER BY DEPTNUM
+> GROUP BY DEPTNUM, JOBCODE;
S> DETAIL DEPTNUM AS I6 HEADING "Dept.",
+> JOBCODE AS I4 HEADING "Job",
+> COL 3 AS M<$ZZZ,ZZZ,ZZZ.99>
+> HEADING "Sum of Salaries";
S> BREAK ON DEPTNUM ;
S> SUBTOTAL COL 3 OVER DEPTNUM ;
S> TOTAL COL 3;
S> LIST ALL ;
Figure 4-15 shows the report.
Figure 4-15. Example of Monetary Total and Subtotals
.
.
.
.
.
.
.
.
.
1000 100 $ 137,000.10
500
900
$ 104,000.75
$ 19,000.00
*
$ 260,000.85
Dept.
Job
Sum of Salaries
9000 100 $ 175,500.00
900
$ 37,000.00
*
$ 212,500.00
$ 2,780,725.57
--- 34 row(s) selected.
> >
VST0415.vsd