Last post Aug 07, 2012 12:47 AM by __MATTA
Aug 07, 2012 12:47 AM|__MATTA|LINK
Had this problem and the it was fixed was by giving the proper name to the objects used in the C#/VB code, same as the data set name used in the .rdlc report.
DataSet ds = new DataSet();
ds.DataSetName = "myrdlcdataset"; //same name used within the rdlc report file
ds.Tables.Add("myrdlcdataset"); //same name used within the rdlc report file
ds.Tables.Load(dr); // Please populate data reader with some data.
ReportDataSource rds = new ReportDataSource();
rds.Name = "myrdlcdataset"; //same name used within the rdlc report file
rds.Value = ds.Tables;
rptrdlc.ReportPath = @"C:\MyReports\MyReport.rdlc";
byte bytes = rptRocheDailyReport.Render("EXCEL");
Giving the same name as the dataset used in the report, generates the report properly.
Hope it helps!