//设置本地报表,使程序与之前所建的testReport.rdlc报表文件进行绑定.
string P_Path = AppDomain.CurrentDomain.BaseDirectory + "Report1.rdlc";
reportViewer1.LocalReport.ReportPath = P_Path;
reportViewer1.LocalReport.DataSources.Clear();
reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", dataSet.Tables[0]));
reportViewer1.ProcessingMode = ProcessingMode.Local;
List paramList = new List();
paramList.Add(new ReportParameter("ReportParameter2", dateTimePicker1.Text));
//paramList.Add(new ReportParameter("ReportParameter2", textBox1.Text, false));
///----------------------------------------运行到这就报错,如果注释了就正常显示,但是参数没有传-----------------------------------------
//this.reportViewer1.ServerReport.SetParameters(paramList);
reportViewer1.RefreshReport();
图片.png
(181.69 KB, 下载次数: 0)
2019-11-6 15:31 上传
代码
2019-11-6 15:32 上传
报错信息