Use Rava to generate master-slave relationship reports
Bytes -----------------------------------------------------------------------------------------------------------
References
1. Add rvproject1, rvsystem1,
Rvproject1.engine: = rvsystem1
Rvproject1.loaddesigner: = false
Rvproject1.projectfile: = 'C:/myrave/project1.rav'
2. Add Table1, Table2, rvtableconnection1, rvtableconnection2,
Table1 connects to the dbdemos database table customer [master table], Table2 connects to the dbdemos database table orders [slave table]
3. Set table2.filteroptions: = [fonopartialcompare],
Rvtableconnection1:
Rvtableconnection1.runtimevisibility: = rtenduser
Rvtableconnection1.table: = Table1
Rvtableconnection2.runtimevisibility: = rtenduser
Rvtableconnection2.table: = Table2
4. Set
Page1.bin: = middle Tray
Page1.pagersize: = custom
5. In the ravereport design environment
Add dataview1 and dataview1 to rvtableconnection1
Add dataview2 and dataview2 to rvtableconnection2
6. In the ravereport design environment
Add region1, databand1, databand2 to page1, and add a data display control to databand1 and databand2.
7. Set
Databand1.dataview: = dataview1
Databand2.controllerband: = databand1
Databand2.dataview: = dataview2
Databand2.detailkey: = custno
Databand2.masterdataview: = dataview1
Databand2.masterkey: = custno
8. Set the datatext Control
Datatext1.datafield: = custno
Datatext1.dataview: = dataview1
Datatext1 on databand1
Datatext2.datafield: = custno
Datatext2.dataview: = dataview2
Datatext2 on databand2
9. Set databand1 and databand2
In the databand1 attribute box, click the attribute bandstyle. In the displayed dialog box, select first, new page under print occurrence.
In the databand2 attribute box, click the attribute bandstyle. In the displayed dialog box, select first under print occurrence,
Detail under print location
Follow these steps to create a master-slave report
Currently, I know two methods:
First
Do not set hard mastdetail on the foreground, that is, do not set it through the mastsource attribute of dataset.
Otherwise, he will not be able to die, and the foreground will pass
The dynamic filter sub-statement indicates that the filter is used, or the setrange is not used for SQL queries.
The report format is set by placing two databand, The controllerband of the databand in the detail table
Point to the databand of the master table, click the bandstyle attribute, and hook detail;
Second
Set it directly in the report without any code at the front end,
The above steps remain unchanged. Set masterkey below
Master key is the key of the primary table, dataview
Detailkey is the slave table key.
However, compound primary keys are not supported.