To embed a subreport into a parent report, you add two reports (one parent and one child report) to a Visual Studio project, and from the ActiveReports 18 Section Report toolbox, drag the SubReport control onto the parent report. The following steps take you through the process of adding a subreport in a Section Report.
These steps assume that you have already added a Section Report (code-based) template in a Visual Studio project.
Visual Basic.NET code. Paste JUST ABOVE the ReportStart event. |
Copy Code
|
---|---|
Dim rpt As rptYourChildReportName |
Visual Basic.NET code. Paste INSIDE the ReportStart event. |
Copy Code
|
---|---|
rpt = New rptYourChildReportName()
|
C# Code:
C# code. Paste JUST ABOVE the ReportStart event. |
Copy Code
|
---|---|
private rptYourChildReportName rpt;
|
C# code. Paste INSIDE the ReportStart event. |
Copy Code
|
---|---|
rpt = new rptYourChildReportName();
|
Visual Basic.NET code. Paste INSIDE the Format event. |
Copy Code
|
---|---|
Me.SubReport1.Report = rpt
|
C# code. Paste INSIDE the Format event. |
Copy Code
|
---|---|
this.subReport1.Report = rpt;
|