ActiveReports 6 Online Help
Subreports

In ActiveReports, you can embed a report in another report using the Subreport control. Once you place the Subreport control on a report, you attach a report object to it in code. You can pass parameters to the subreport from the main report, ensuring that data related to the main report displays in each instance of the subreport.

Since they render inside the main report, subreports are disconnected from any concept of a printed page. For this reason, page-dependent features are not supported for use in subreports. Keep any such logic in the main report. Page-related concepts that are not supported in subreports include:

Because of the high overhead of running a second report and embedding it in the first, it is generally best to instead use grouping wherever possible. If grouping cannot accommodate your particular report, use subreports. Some uses of subreports include:

As a best practice, create an instance of the report for your Subreport control in the ReportStart event of the main report, and then dispose of it in the ReportEnd event. In this way, you are creating only one subreport instance when you run the main report.

If you instantiate the subreport in a section Format event, it creates a new instance of the subreport each time the section processes. This consumes a lot of memory and processing time, especially in a report that processes a large amount of data.

See Also

How To

Related Sections

Walkthroughs