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

Selecting Data for a Report
HP NonStop SQL/MP Report Writer Guide—527213-001
3-27
Using Views
To further simplify your task, you can specify in an EDIT file the set of report formatting
commands to print the invoice.
The following commands define one version of an invoice. These commands are
stored in a file named INVOICE. For explanations and examples of the report
formatting commands used in this report, see Section 4, Customizing a Report.
SET LAYOUT RIGHT_MARGIN 65, PAGE_LENGTH 24;
PAGE TITLE "INVOICE" CENTER;
REPORT TITLE "Customer: ", CUSTNAME,
TAB 40, "Order Date: ", ORDER_DATE AS I6,
SKIP 1,
TAB 11, STREET,
TAB 40, "Deliv. Date: ", DELIV_DATE AS I6,
SKIP 1,
TAB 11,
CONCAT (CITY STRIP, ", ", STATE STRIP, SPACE 1,
POSTCODE),
TAB 40, "Order No.", ORDERNUM;
DETAIL PARTNUM AS I6
HEADING "Part No.",
UNIT_PRICE AS F8.2
HEADING "Unit Price",
QTY_ORDERED AS I8
HEADING "Quantity",
UNIT_PRICE * QTY_ORDERED AS M<$ZZZ,ZZ9.99>
HEADING "Total" NAME TOTALPRICE ;
TOTAL TOTALPRICE;
REPORT FOOTING "Terms 60 days net.";
To print an invoice, enter the following commands:
>> SET LIST_COUNT 0;
>> SELECT * FROM RWVIEWS.CUSTORD
+> WHERE CUSTNUM = 1234 AND ORDERNUM = 100210;
S> OBEY INVOICE;
Figure 3-7 shows a sample invoice (line numbers do not appear on the printed report).