2015-02-17 3 views
0

Я использую VS 2012 Ultimate, SAP Crystal Reports 13_0_13 (последняя версия).Кнопка просмотра Crystal Report Следующая страница не работает в ASP.NET

Проблема заключается в том, что когда я нажимаю кнопку «Следующая страница» Crystal Report Viewer, она продолжает загрузку и никогда не заканчивается.

Я использую следующий код.

protected void btn_search_Click(object sender, EventArgs e) 
{ 
    Session["ReportDocument"] = null; 
    loadReport(param1,param2,param3,param4); 
} 

loadReport функция:

private void loadReport(string Param1, string Param2, string Param3, string param4) 
{ 
    CrystalReportViewer1.Visible = true; 

    ReportDocument reportDocument = new ReportDocument(); 
    string reportPath = Server.MapPath(@"~/VacantAndFilledReports/rpt_vacantposts_HR.rpt"); 
    reportDocument.Load(reportPath); 

    reportDocument.SetDatabaseLogon(ID, pass, serverName, databaseName); 
    reportDocument.SetParameterValue("@Param1", Param1); 
    reportDocument.SetParameterValue("@Param2", Param2); 
    reportDocument.SetParameterValue("@Param3", Param3); 
    reportDocument.SetParameterValue("Param4", Param4); 

    CrystalReportViewer1.ReuseParameterValuesOnRefresh = true; 
    CrystalReportViewer1.AutoDataBind = true; 
    CrystalReportViewer1.Zoom(88); 
    CrystalReportViewer1.ReportSource = reportDocument; 

    Session["ReportDocument"] = reportDocument; 
} 

Я также разместить код в Page_Init:

protected void Page_Init(object sender, EventArgs e) 
{ 
     if (Session["ReportDocument"] != null) 
     { 
      ReportDocument doc = (ReportDocument)Session["ReportDocument"]; 
      CrystalReportViewer1.ReportSource = doc; 
     } 
} 

Я искал аа много о странице кнопки Далее, все сообщения были относительно поместить код внутри Page_Init но, как и выше, не работает для меня.

ответ

0

Вместо Page_init поместите тот же кусок кода в Page_Load

Смежные вопросы