Skip to Content
0
Former Member
Mar 04, 2011 at 02:28 AM

Data not binding to subreport

43 Views

Hi. I am using CR2008 and VS2010.

I have two reports MainReport.rpt and SubReport.rpt. I have two datasets, MainDS and SubReportDS. I designed both these reports using these two datasets. In my web application, I am setting the datasource and binding the reports. But when I run my report, I do not see any data in my subreport even though I have data in my dataset.

My code is as follows:

ReportDocument rDoc = new ReportDocument();
rDoc.Load(Server.MapPath("MainReport.rpt"));
rDoc.SetDataSource(MainDS);
rDoc.OpenSubReport("SubReport.rpt").SetDataSource(SubReportDS);

crv.ReportSource = rDoc;
crv.DataBind();

Edited by: realGaurab on Mar 4, 2011 3:29 AM