This is a migrated thread and some comments may be shown as answers.

Report is unavailable or session has expired.

2 Answers 233 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 2
Joel asked on 28 Dec 2007, 07:55 PM
-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 Answers, 1 is accepted

Sort by
0
Hrisi
Telerik team
answered on 02 Jan 2008, 03:31 PM
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
0
Accepted
Joel
Top achievements
Rank 2
answered on 02 Jan 2008, 05:29 PM
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 

Tags
General Discussions
Asked by
Joel
Top achievements
Rank 2
Answers by
Hrisi
Telerik team
Joel
Top achievements
Rank 2
Share this question
or