只能从钻取报表执行操作

时间:2012-09-27 06:00:08

标签: rdlc

  protected void ReportViewer1_Back(object sender, BackEventArgs e)
    {       
        GetReportData();
    }

只能从钻取报表执行操作当我使用报表查看器后退按钮事件重新加载父报表时,抛出此错误。

这是GetReportData()方法

protected void GetReportData()
    {
        try
        {
            DataSet dsreport = bd.bStatePerfomanceReport(Convert.ToInt32(ddlYear.SelectedValue), reportdetail.month, Convert.ToInt32(rdbCol.SelectedValue));
            ReportViewer1.Visible = true;
            ReportDataSource rds = new ReportDataSource();
            ReportViewer1.Reset();
            ReportViewer1.ProcessingMode = ProcessingMode.Local;
            LocalReport rep = ReportViewer1.LocalReport;
            rep.Refresh();
            rep.ReportPath = "rdlc/StateataGlance.rdlc";
            rds.Name = "dsReport_uspReport_StateataGlance";
            rds.Value = dsreport.Tables[0];
            rep.DataSources.Add(rds);

            ReportParameter[] parms = new ReportParameter[3];
            parms[0] = new ReportParameter("month", ddlMonth.SelectedItem.Text + ",  " + ddlYear.SelectedItem.Text, true);
            parms[1] = new ReportParameter("mo", ddlMonth.SelectedValue, true);
            parms[2] = new ReportParameter("year", ddlYear.SelectedValue, true);
            this.ReportViewer1.LocalReport.SetParameters(parms);
            rep.Refresh();
            ViewState["level"] = 0;
        }
        catch
        {
        }
    }

并且它正在处理页面加载事件,但是当我在后退按钮事件上调用相同的方法时,它会抛出一个错误。

0 个答案:

没有答案