我reportviewer
用来报告的问题是,当我第一次绑定报告时,意味着当用户从组合框中选择报告类型时,它会完美显示,但是当用户从组合框中选择第二个选项时,它会给我错误An error occurred during local report processing
。为了您的审查,我提供了代码
switch (cmbReports.SelectedValue.ToString())
{
case "01":
#region Salaries and Wages Ytd
ReportParameter pCase1 = new ReportParameter("reportHeading", "SALARIES AND WAGES TRENDS (US$) FOR THE YEAR AS AT :" + taxmnth);
_parmList.Add(pCase1);
List<FiscalPeriod> _FisclList = new List<FiscalPeriod>();
if (AcctPrd == crntActPrd)
_FisclList = _reportComp.getGraphRpt_salWageY2d(crntActPrd);
else
_FisclList = _reportComp.getGraphRpt_salWageY2d_hist(AcctPrd);
ReportDataSource rds1 = new ReportDataSource("dsFiscalPrd", _FisclList);
this.reportViewerGraph.ProcessingMode = ProcessingMode.Local;
LocalReport repCase1 = reportViewerGraph.LocalReport;
repCase1.DataSources.Clear();
repCase1.ReportPath = ConfigurationSettings.AppSettings["GraphicalReportPath"].ToString() + @"Sal_WagesY2dReport.rdlc";
repCase1.SetParameters(_parmList);
repCase1.DataSources.Add(rds1);
repCase1.Refresh();
this.reportViewerGraph.RefreshReport();
#endregion
break;
case "02":
printType();
#region Incomes Ytd
ReportParameter pCase2 = new ReportParameter("reportHeading", " INCOMES (US$) FOR THE YEAR AS AT: " + taxmnth);
_parmList.Add(pCase2);
List<FiscalPeriod> _FisclList1 = new List<FiscalPeriod>();
if (AcctPrd == crntActPrd)
_FisclList1 = _reportComp.getGraphRpt_WFAnalysisY2d(crntActPrd);
else
_FisclList1 = _reportComp.getGraphRpt_WFAnalysisY2d_hist(AcctPrd);
ReportDataSource rds2 = new ReportDataSource("dsfiscalperiod", _FisclList1);
this.reportViewerGraph.ProcessingMode = ProcessingMode.Local;
LocalReport repCase2 = reportViewerGraph.LocalReport;
repCase2.DataSources.Clear();
repCase2.ReportPath = ConfigurationSettings.AppSettings["GraphicalReportPath"].ToString() + @"IncomesY2dReport.rdlc";
repCase2.SetParameters(_parmList);
repCase2.DataSources.Add(rds2);
repCase2.Refresh();
this.reportViewerGraph.RefreshReport();
#endregion
break;
}
你能告诉我我做错了什么吗?