Chapter 15: Working with Sub Reports

 

A sub report is a report that is embedded inside another report. The report that contains the sub report is called the main report. More than one sub report can be embedded into a main report, and sub reports themselves can have embedded sub reports.

 

 

report_sub_report_relationship_diagram

 

 

A main report does not have to be bound to a table or query; it can simply be used as a container for a collection of one or more unrelated sub reports.

 

Alternatively, a main report can be bound to a table or query, and include one or more sub reports containing information related to the main report.

 

The Creating a container report section of this chapter guides you through setting up a main report as a container with two sub reports.

 

The Creating a bound report section of this chapter explains how to create a main report showing detail records for a bound table, and how to use a sub report to display summary data for each detail record.

 

Note that the sample project Chapter15_UsingSubReports.pnj is used in the following procedures. You can access this project by clicking File – Open Project in the application menu, then enabling the Open a sample project option.