日期:2014-05-20 浏览次数:20927 次
ReportView1.Reset(); Dataset ds=new DataSet(); ReportView1.ProcessingMode = ProcessingMode.Local; Microsoft.Reporting.WebForms.ReportDataSource rds = new ReportDataSource(); rds.Value = ds.Tables[0]; LocalReport r = ReportView1.LocalReport; r.DataSources.Add(rds);//add datasource
------解决方案--------------------
ReportDataSource myRptDS = new ReportDataSource(); myRptDS.DataSourceId = "ObjectDataSource1"; ReportViewer1.LocalReport.DataSources.Add(myRptDS); ReportViewer1.LocalReport.Refresh();