ReportViewer1.LocalReport.DataSources.Clear();
LocalReport rep = ReportViewer1.LocalReport;
ReportDataSource rds = new ReportDataSource();
rds.Name = "DataSet1"; //this is the name of the DataSet on your report rdlc
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("dataset1", ObjectDataSource1));
rep.ReportPath = "Report1.rdlc";
DataSet ds = new DataSet();
答案 0 :(得分:0)
ReportViewer1.ProcessingMode = ProcessingMode.Local;
LocalReport rep = ReportViewer1.LocalReport;
rep.ReportPath = "Reports/YourReport.rdl";
rep.DataSources.Clear();
ReportDataSource rds1 = new ReportDataSource();
rds1.Name = "DataSet1";
rds1.Value = dt; // Your Pass in Dataset value (type : DataTable)
rep.DataSources.Add(rds1);
rep.Refresh();