Managing Reports with Sub-Reports
Our sample projects and report templates can help you learn the basics of working with our products.A master report can host sub-reports that pull their own data, letting you compose complex documents from independent templates.
Loading the master. Load the template (its sub-report components reference the nested reports) and display it:
How it works. Each sub-report renders in the context of the master's current row, producing master-detail output from separately maintained templates.
Loading the master. Load the template (its sub-report components reference the nested reports) and display it:
private StiReport GetReport(string name)
{
var report = new StiReport();
using (var stream = Assembly.GetExecutingAssembly()
.GetManifestResourceStream("Managing_Reports_with_Sub_Reports." + name))
{
report.Load(stream);
}
return report;
}
GetReport("MasterDetail.mrt").Show();- The master
.mrtcontainsStiSubReportcomponents that bind to the detail bands. - Loading from a manifest resource stream keeps the templates embedded in the assembly.
How it works. Each sub-report renders in the context of the master's current row, producing master-detail output from separately maintained templates.