cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Report Viewer Next Page button does not work in ASP.NET

0 Kudos

I am using VS 2012 Ultimate , SAP Crystal Reports 13_0_13 (latest version). The problem is that when i click on crystal report viewer next Page button it goes on loading and never end, i am using the following code.



Protected void btn_Search_Click(object sender, EventArgs e)

{

     Session["ReportDocument"]=null;

     loadReport(Param1,Param2,param3,Param4);

}

load Report function



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);

            reportDocument.SetParameterValue("Title", FundName);

            CrystalReportViewer1.ReuseParameterValuesOnRefresh = true;

            CrystalReportViewer1.AutoDataBind = true;

            CrystalReportViewer1.Zoom(88);

            CrystalReportViewer1.ReportSource = reportDocument;

            Session["ReportDocument"] = reportDocument;

      

    }


I have also put the code in Page_Init



protected void Page_Init(object sender, EventArgs e)

    {

        if (Session["ReportDocument"] != null)

        {

            //Response.Write("Hello");

            ReportDocument doc = (ReportDocument)Session["ReportDocument"];

            CrystalReportViewer1.ReportSource = doc;

        }

    }

I have searched a lot regarding Page Next Button of crystal report viewer but all there was to put code inside Page_Init, i tried as above but did't get the solution and still it is on Page 1 and does not go to Page 2.

Please tell me where i am doing wrong?

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

See this KBA:

SAP Note 1985571 - How to use sessions in web applications using the Crystal Reports viewer (the com...

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

Hi Ludek,

I have tried using SAP Note 1985571 for the next button to work but not working.

I use vs2012 ultimate and SAP 13.0.13 crystal report, when i click on the next button it hangs, the export and print buttons works

Pls help

Answers (1)

Answers (1)

0 Kudos

Add Session code to keep the report in session and a postback method to tell the report it is in an active session.

Search, there are sample available.