我正在尝试在 rdlc 报告的子报告中传递参数。我有用户 ReportParameter 但是当我执行它时,该函数没有被调用并且它显示“无法显示报告”
ReportParameter[] paramReport = new ReportParameter[6];
paramReport[0] = new ReportParameter("Month1", (DateTime.ParseExact(fromd1.ToString("dd/MMM/yyyy"), "dd/MMM/yyyy", CultureInfo.InvariantCulture)).ToString("MMMM"), false);
paramReport[1] = new ReportParameter("Month2", (DateTime.ParseExact(fromdate2.ToString("dd/MMM/yyyy"), "dd/MMM/yyyy", CultureInfo.InvariantCulture)).ToString("MMMM"), false);
paramReport[2] = new ReportParameter("Month3", (DateTime.ParseExact(dt_todate3.ToString("dd/MMM/yyyy"), "dd/MMM/yyyy", CultureInfo.InvariantCulture)).ToString("MMMM"), false);
paramReport[3] = new ReportParameter("Month4", (DateTime.ParseExact(dt_todate4.ToString("dd/MMM/yyyy"), "dd/MMM/yyyy", CultureInfo.InvariantCulture)).ToString("MMMM"), false);
paramReport[4] = new ReportParameter("Month5", (DateTime.ParseExact(dt_todate5.ToString("dd/MMM/yyyy"), "dd/MMM/yyyy", CultureInfo.InvariantCulture)).ToString("MMMM"), false);
paramReport[5] = new ReportParameter("Month6", (DateTime.ParseExact(dt_todate6.ToString("dd/MMM/yyyy"), "dd/MMM/yyyy", CultureInfo.InvariantCulture)).ToString("MMMM"), false);
this.ReportViewer1.LocalReport.SetParameters(paramReport);
this.ReportViewer1.LocalReport.Refresh();
以上是我将参数传递给子报告的代码。但是这段代码不起作用。
如果有人知道如何做到这一点,请帮助我..
提前致谢