Skip to Content
0
Former Member
Dec 20, 2015 at 05:11 PM

asp.net CrystalReportViewer paging problem

462 Views

Issue: Cannot navigate past page 2. Seems very common with a lot of people having this problem.

There is at least 10 threads about this here and none of them have the answer.

The standard canned response is 'use Page_Init()'.

The situation is this:

  • All logic MUST BE IN Page_Load()!

There are several reason for this... I don't know the report name and parameters until the user selects them.

So I repeat. Page_Init is NOT AN OPTION.

I want to make this clear because none of the previous posters made this clear and got a ton of responses to use Page_Init() and they kept posting that they CANNOT use this event - just like me and people refusing to help them because the original poster won't use Page_Init().

It does work if I hardcode the report parameters OR pass the parameters to the page and use Page_Init()

I need it to work in Page_Load().

I have the following pseudocode based on code from here:

SAML Response from SAP Cloud Identity

protected void Page_Load(object sender, EventArgs e)

{

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

{

DataSet ds = new DataSet();

// Get parameters from user , create datasource, etc etc.

ReportDocument rpt = new ReportDocument();

rpt.SetDataSource(ds);

Session["ReportDocument"] = rpt;

CrystalReportViewer.ReportSource = rpt;

}

else

{

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

CrystalReportViewer.ReportSource = rpt;

}

}

"next page" past page 2 still not working.

Can export to PDF, print, etc all work.

Selecting pages above 3 manually works.