Normally, there is no data connection between subreports and primary reports.
The main purpose is to display several irrelevant data tables in one report.
However, in actual operations, the subreport must be associated with the main report in the following two cases:
1: A common grouping report (when the primary table and the detail table are associated). If only one primary report is used for display
If no data exists in the table, the data in the table cannot be displayed in the report due to association.
2: During grouping, You need to display multiple tables according to the master table in the details section.
You can use the link subreport to solve this problem.
In the following operations, I use a master table to correspond to the database files of two tables,
Complete the operation of grouping by the main table and display the content of the two tables in the details section.
The data in the primary table can be properly displayed.
The basic steps are as follows:
Start from the master table and make a report, grouped by "name"
Add the subreport R1 to display data in the book,
To filter data by name in the primary table, change the subreport connection and connect the field name of the primary report to stuname in the book.
Of course, you can connect to parameter fields instead of specific fields as needed, but not here.
Add subreport R2 to display data in class
To filter data by name in the main table, change the subreport connection and connect the field name in the main report to stuname2 in class.
To improve the appearance of reports, suppress unnecessary sections in subreports.
In addition, do not display the subreport table corresponding to the group data if there is no data.
You can set it as follows [see Figure].
Download the operation photo file here
============================================
Atai 20050601
20080311: Fixed image connection problems in this article