ActiveReports 6 Online Help
Embed Subreports in a Report
Show AllShow All
Hide AllHide All

To embed a subreport into a parent report, you add two reports to a Visual Studio project, and from the ActiveReports toolbox, drag the SubReport control onto one of the reports. You can then add code to create an instance of the child report, and to display it in the SubReport control.

To add code to create an instance of the child report

Warning: Do not create a new instance of the subreport in the Format event. Doing so creates a new subreport each time the section Format code is run, which uses a lot of memory.

To write the code in Visual Basic

To write the code in C#

To add code to display the child report in a subreport control on a parent report

  1. Double-click in the detail section of the design surface of the parent report to create a detail_Format event.
  2. Add code to the handler to display a report in the subreport control.

To write the code in Visual Basic

To write the code in C#

See Also

Related Sections

Concepts