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-52
Calculating Subtotals
+> AND PS.SUPPNUM = S.SUPPNUM
+> ORDER BY S.SUPPNUM, P.PARTNUM;
S> DETAIL PARTNUM AS I6 HEADING "Part/Number" CENTER,
+> QTY_AVAILABLE AS I9 HEADING "Available/Units" CENTER,
+> PARTCOST AS F11.2 HEADING "Unit Cost/(dollars)" CENTER,
+> PARTCOST * QTY_AVAILABLE AS F14.2
+> HEADING "Total Cost/(dollars)" CENTER
+> NAME TOTAL_COST,
+> QTY_AVAILABLE * (PRICE - PARTCOST) AS F11.2
+> HEADING "Estimated/Profit" CENTER
+> NAME PROFIT;
S> BREAK ON S.SUPPNUM;
S> BREAK TITLE S.SUPPNUM
+> ("Supplier:", S.SUPPNUM,
+> CONCAT (SUPPNAME STRIP, ", ",CITY STRIP, ", ",
+> STATE),
+> SKIP 1) ;
S> SUBTOTAL TOTAL_COST, PROFIT OVER S.SUPPNUM;
+> TOTAL TOTAL_COST, PROFIT;
S> PAGE TITLE "Supplier Parts Summary" CENTER;
S> REPORT TITLE "Date: ",
S> CURRENT_TIMESTAMP AS DATE “MA DB2, Y4”,
+> TAB 48,
+> "Time: ", CURRENT_TIMESTAMP AS TIME *;
S> REPORT FOOTING "End of Summary" CENTER;
S> PAGE FOOTING TAB 58, "Page ", PAGE_NUMBER AS I3;
S> OUT_REPORT $S.#PRINTER;
S> LIST ALL;
Figure 4-20 shows the resulting two-page report.