I would like to create external subreport which will be reusable in many main reports.
Datasource is dataset with two tables - master and detail with one common column.
I have problem to set relationship between reports due to problem with setting Databand's MasterComponent in subreport.
Code: Select all
void report_GetSubReport(object sender, StiGetSubReportEventArgs e)
{
StiReport subReport = new StiReport();
subReport.Load("subreport.mrt");
subReport.RegData("ds", _Dataset);
var data = (StiDataBand)subReport.GetComponentByName("Detail");
var parentC = parentReport.GetComponentByName("DataMain");
data.MasterComponent = parentC; // this has no effect
subReport.Compile();
e.Report = subReport;
}
How can I do this?
Thank you for help,
mira