I just updated one of my smaller reporting projects, containing 32 reports, with the latest Q2 2012 code. Several of the reports contain sub reports. I am, as of Q2 2012, unable to directly set the data source property.
In prior versions of the code I would do something like:
List<BusinessObject> iData = new List<BusinessObject>;
List<BusinessObject2> iSubData = new List<BusinessObject2>;
Report r = new Report();
r.DataSource = iData;
SubReport sr = (SubReport)r.Items.Find("subreportname", true)[0];
if (sr != null) {
sr.ReportSource.DataSource = iSubData;
}
Under Q2 it does not seem to be possible to directly set the datasource. All the instructions say "InstanceReportSource" however I cannot see how to use this with a sub report. Can someone tell me what I am missing? The online docs seem to imply I must use a need datasource event. That would require a complete redesign of my "generic" report logic.
In prior versions of the code I would do something like:
List<BusinessObject> iData = new List<BusinessObject>;
List<BusinessObject2> iSubData = new List<BusinessObject2>;
Report r = new Report();
r.DataSource = iData;
SubReport sr = (SubReport)r.Items.Find("subreportname", true)[0];
if (sr != null) {
sr.ReportSource.DataSource = iSubData;
}
Under Q2 it does not seem to be possible to directly set the datasource. All the instructions say "InstanceReportSource" however I cannot see how to use this with a sub report. Can someone tell me what I am missing? The online docs seem to imply I must use a need datasource event. That would require a complete redesign of my "generic" report logic.