Report is unavailable or session has expired.

3 posts, 1 answers
  1. Joel
    Joel avatar
    166 posts
    Member since:
    Oct 2006

    Posted 28 Dec 2007 Link to this post

    -Update:-  I saw version 2.0 was released so I upgraded to that, repointed all references etc and still get same error.  Works find in preview and html preview, but cannot display via aspx.-  Just querying a 3 column table with 6 rows.


    Anyone know of what this error may be from?  Other telerik reporting pages withing the same app work fine, though they don't use the group functionality.  The page loads in the preview button fine.  I get the error below through the webpage however.  Is there any kind of debug mode to get an actual error?

    Only thing on the page is the reportviewer was dropped on the aspx page and this is in the code behind:

    Imports CEReports
    Partial Class Reports1_aaa
        Inherits System.Web.UI.Page
        Protected Sub Page_PreRenderComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRenderComplete
            Dim myreport As New CEReports.aaa
            ReportViewer1.Report = myreport
        End Sub
    End Class

    Report is unavailable or session has expired.

    Please, refresh the page.


  2. Hrisi
    Admin
    Hrisi avatar
    221 posts

    Posted 02 Jan 2008 Link to this post

    Hello Joel,

    Please, try moving the code to the Page_Load event handler. This should fix the issue you are faced with. 

    Greetings,
    Hrisi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft banner
  4. Answer
    Joel
    Joel avatar
    166 posts
    Member since:
    Oct 2006

    Posted 02 Jan 2008 Link to this post

    Thank you Hrisi,

    Due to perhaps a flaw in our master page templates, this needs to go into prerender_complete or we get a "Object Reference not set to an instance of an object" error on reportviewer1.

    Going back to similar problems with the radgrid, I tried it this way by just using a placeholder in the .aspx page and using the addhandler functionality in page_init.  It seems to now be working.  Thank you for pointing out the lifecycle issue!

    -Joel

     
        Dim ReportViewer2 As Telerik.ReportViewer.WebForms.ReportViewer = New Telerik.ReportViewer.WebForms.ReportViewer 
     
        Private Sub ReportDataBind(ByVal source As Object, ByVal e As System.EventArgs) 
            Dim myreport As New CEReports.sectionquant 
            CType(source, Telerik.ReportViewer.WebForms.ReportViewer).Report = myreport 
        End Sub 
     
        Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init 
            AddHandler ReportViewer2.DataBinding, AddressOf ReportDataBind 
        End Sub 
     
     
        Protected Sub Page_PreRenderComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRenderComplete 
            ReportViewer2.DataBind() 
            phReport.Controls.Add(ReportViewer2) 
        End Sub 

Back to Top