You can print data from more than one dataview on a single detail line by specifying the column name on the Detail fill‑in. For example, a report named ORDRPT is created to print a list of all outstanding orders by order ID. The order identification number and the customer identification number are taken from the ORDER dataview. The customer name and salesman ID are taken from the CUSTOMER dataview. The field name qualifiers shown in the following screen indicate which dataview obtains the data.
=> ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑ IDEAL : RPT DETAIL DEFN. RPT CUSTRPT (001) TEST SYS: DOC DISP Field Name, Literal, Sort Break Function Column Function, or L A L S I T M M A H W Command Arithmetic Expression V / V K N O A I V D ID Tab Edit Pattern L D L P D T X N G G TH ‑‑‑‑‑‑ ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑ ‑ ‑ ‑ ‑ ‑ ‑ ‑ ‑ ‑ ‑ ‑‑ ‑‑‑ ‑‑‑‑‑‑‑‑‑‑‑‑‑ ====== =========== T O P ======= = = = = = = = = = = == === ============= 000400 ORDER.ORDID _ _ _ _ _ _ _ _ _ _ __ ___ _____________ 000500 ORDER.CUSTID _ _ _ _ _ _ _ _ _ _ __ ___ _____________ 000600 CUSTOMER.NAME _ _ _ _ _ _ _ _ _ _ __ ___ _____________ 000700 CUSTOMER.SLMNID _ _ _ _ _ _ _ _ _ _ __ ___ _____________ ====== ========= B O T T O M === = = = = = = = = = = == === =============
The column heading information is taken from the DataDictionary.
The following code generates the report. The PRODUCE statement is coded in the FOR FIRST CUSTOMER construct to ensure that the customer information prints with the order information.
FOR EACH ORDER
FOR FIRST CUSTOMER
WHERE CUSTOMER.CUSTID EQ ORDER.CUSTID
PRODUCE ORDRPT
ENDFOR
ENDFOR
The sequence in which the details print reflects the sequence in which the rows are retrieved from the database. The following sample shows the resulting detail lines:
ORDID CUSTID NAME SLMNID 1021 A0130 SUN DIAL GROWERS 29390 1023 A0150 IMPERIAL BANKCORP 13150 1013 B0230 CHEMICAL MUTUAL 00725 . . .
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|