Friday, March 30, 2012

ReportViewer error "Page navigation is out of range"

I am embedding the ReportViewer in an aspx page and the report comes up fine, but when I press the "Next Page" or "Last Page" buttons, I get the error: "Page navigation is out of range".

The application has session state turned off.
The problem occurs whether or not the viewstate for ReportViewer is turned on or off.

How can I fix this problem?I have exactly the same problem...anyone out there from MS monitoring this? Please help! Thanks!|||

I also had the same problem.

Can you try setting you internet-intranet security settings to Medium-Low and then try generating the reports? There seems to be some problem with storing of cookies because of which it gives this error.

Hope it helps!!!

|||Page navigation is a postback. Look at what you are doing in the PageLoad when IsPostBack == true.|||

Hi BradB,

what are the things that can cause such error in the pageload if it's a postback?

i encountered this error but my coding uses !IsPostBack , will that be a difference?

|||

I figured out a workaround. It appears that the error occurs when you set the ServerPage during the postback. Don't explicitly set the ReportServerUrl or ReportPath during postback and it should work:

/* Insert the following two lines before setting ReportServerUrl or ReportPath */
if (IsPostBack)
return;

Report.ServerReport.ReportServerUrl = new Uri(@."http://localhost/ReportServer");
Report.ServerReport.ReportPath = @."/MyReportDirectory/MyReport";

|||thanks! works perfectly..|||That was it exactly. Thanks.|||

Perfect.

You made my day.

Thanx.

No comments:

Post a Comment