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?

[384 byte] By [gulpie] at [2007-12-25]
# 1
I have exactly the same problem...anyone out there from MS monitoring this? Please help! Thanks!
sutorius at 2007-9-3 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 2

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!!!

Ingenious at 2007-9-3 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 3
Page navigation is a postback. Look at what you are doing in the PageLoad when IsPostBack == true.
BradB at 2007-9-3 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 4

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?

minority80 at 2007-9-3 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 5

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

korggy at 2007-9-3 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 6
thanks! works perfectly..
minority80 at 2007-9-3 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 7
That was it exactly. Thanks.
HarlenCompton at 2007-9-3 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 8

Perfect.

You made my day.

Thanx.

uli69 at 2007-9-3 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...

SQL Server

Site Classified