EK RTF master-details example


Component TEkRTF is used In this example with properties: Lang=wdEnglishUS, Name=EkRTF, DisableControls=false, properties InFile, OutFile reference to rtf files. Other properties are left without changing.

There are used tables ORDERS, CUST, ITEMS from DBDEMOS database. In the table ITEMS MasterFields=OrderNo, MasterSource=OrdersSource. Tables are in data module named DM.

Report template:

Before executing the report an user chooses order number in ORDERS table. Current record of table ORDERS is printed in the report. Block Scan-Endscan inserts all records from table ITEMS, which are linked with table ORDERS on OrderNo.

Code to generate a report:

custno:=Dm.orders.FieldByName('CustNo').AsInteger;
Dm.cust.Locate('CustNo',custno,[]);

EkRtf.ClearVars;
EkRtf.ExecuteOpen([DM.Cust,DM.Orders,DM.Items], SW_SHOW);


Result: