SQL/MP Report Writer Guide

Selecting Data for a Report
HP NonStop SQL/MP Report Writer Guide527213-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).