The XRSubreport
control is used to embed reports into each other; this allows you to solve the
following tasks.
Re-use reports.
This can be useful if there is a particular report
structure that needs to be included in many reports, and if it needs to have a
consistent appearance and functionality. A good example is a report header that
always contains the same information.
Create side-by-side reports.
By placing two subreports
side-by-side, you can create an effective comparison of data coming from two
different reports. For more details on this, see Side-by-Side Reports.
Create master-detail reports.
Another reason for using subreports
is to create master-detail reports (reports with hierarchically linked data).
For more details on this, see Master-Detail Report.
In the End-User Designer, double
clicking a subreport opens its associated report in a new Design Panel tab.
Private Sub subreport1_BeforePrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs) Dim subreport As XRSubreport = CType(sender , XRSubreport) Dim CurrentContact as string = me.GetCurrentRow().Row.Item("Contact").tostring() CType(sender, XRSubreport).ReportSource.FilterString = "CONTACT = '" + CurrentContact + "'"
End Sub