SQL Server Developer Center > SQL Server Forums > SQL Server Reporting Services > ReportViewer error "Page navigation is out of range"
Ask a questionAsk a question
 

AnswerReportViewer error "Page navigation is out of range"

  • Friday, September 15, 2006 7:47 PMgulpie Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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?

Answers

  • Thursday, October 12, 2006 9:34 PMkorggy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

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

All Replies

  • Wednesday, September 27, 2006 8:48 PMsutorius Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I have exactly the same problem...anyone out there from MS monitoring this??? Please help! Thanks!
  • Thursday, September 28, 2006 4:17 AMIngenious Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

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

  • Monday, October 02, 2006 7:16 PMJDC IT Department Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Page navigation is a postback.  Look at what you are doing in the PageLoad when IsPostBack == true.
  • Wednesday, October 11, 2006 6:57 AMminority80 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    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?

  • Thursday, October 12, 2006 9:34 PMkorggy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

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

  • Wednesday, October 18, 2006 7:29 AMminority80 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    thanks! works perfectly..
  • Tuesday, February 13, 2007 8:22 PMHarlen Compton Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    That was it exactly.  Thanks.
  • Friday, March 09, 2007 2:22 PMuli69 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Perfect.

    You made my day.

    Thanx.

  • Thursday, October 18, 2007 8:53 PMMonosohylix Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    How did you embed the ReportViewer to an aspx page mate ?? cos thats what im struggling with right now...
  • Wednesday, November 28, 2007 5:12 PMRaghuRaok Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    Colud you Please send me your code part for Page Navigation
  • Tuesday, December 04, 2007 11:43 AMrangab Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    wow that was really helpfull,. Thanka a looooooooooooooooooooot

  • Friday, January 11, 2008 4:53 PMroadragedsb Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    A follow-up question on this - the workaround is great.  I noticed that the "pages" are longer now than my paper size is set to (they seemed to match my paper size when async was set to true).  Async I have 18 pages (same with PDF export) - No async and I only have 5 long pages.  Any idea if there is a way to control/set this?

    Thanks.
  • Tuesday, July 08, 2008 9:26 PMMihir_Patel Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    thanks, works fine for me.

     

  • Friday, July 25, 2008 4:33 PMPushplata Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Thanks Korggy....

    Its a perfect solution .