我添加了两个参数,首先后台:
ReportParameter rp = new ReportParameter("SignInTime", new DateTime(2001,01,01).ToString());
ReportParameter rp1 = new ReportParameter("Types", "本季度");
reportViewer.LocalReport.SetParameters((new ReportParameter[] {rp, rp1}));
reportViewer.RefreshReport();
然后在RDLC文件中添加参数关联,只要在“报表数据”工具栏中添加参数,参数名称和类型与后台定义相同即可;
或者在RDLC中这样写参数也行:=Parameters!SignInTime.Value