This seems like it should be trivial but I\'m having difficulties.
I have a main report, I have been filling datasets as follows in ReportViewer.aspx.cs.
You need to use SubreportProcessing Event to set your data source. See following walkthrough also.
ReportViewer.LocalReport.SubreportProcessing +=
new SubreportProcessingEventHandler(exampleSubreportProcessingEventHandler);
void exampleSubreportProcessingEventHandler(object sender, SubreportProcessingEventArgs e)
{
e.DataSources.Add(new ReportDataSource("SubReportDataSet", GetSummaryRequestsDataSet()));
}
From provided link SubreportProcessing Event.
The SubreportProcessing event is triggered for every instance of the subreport in the main report, and not just for each subreport definition. If a report contains multiple subreports instances from the same report definition, this event is triggered for each instance.
If the main report has several subreports, you can examine the ReportPath property of the SubreportProcessingEventArgs class to determine which subreport is being processed and supply data for that subreport.