Out of process session state errors

2 posts, 0 answers
  1. Corin
    Corin avatar
    2 posts
    Member since:
    Dec 2014

    Posted 13 Apr 2015 Link to this post

    We're using the ReportViewer control with the Standalone report designer in a VB.net website.

    The designer's .trdx files are uploaded to the server, which are then serialised to XML and stored for later use. When the reports are run, we convert the report to a Telerik.Reporting.InstanceReportSource
    like this (just the relevant code here, the objects also load parameters into the report object but the issues occur even when there are no parameters present in the report):

    Private _ReportObject As Telerik.Reporting.Report
    Private _oInstanceReportSource As Telerik.Reporting.InstanceReportSource

     

    ReportObject = DirectCast(New Telerik.Reporting.XmlSerialization.ReportXmlSerializer().Deserialize(New System.IO.StringReader(_ReportXML)), Telerik.Reporting.Report)

     

    _oInstanceReportSource.ReportDocument = ReportObject

     

     

    We change the connection string to point to the local database and run the reports from there using code from the forum here, and bind the report to the control using the instanceReportSource

    rptView.ReportSource = _oInstanceReportSource
    rptView.DataBind()

    We've made sure to only use the reporting engine data sources (sqldatasource) and we're able to change all the connection strings from whatever they were set up with in the report using code we pulled from the forums here.

    So far, so good.

    We have intermittent errors:

    Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode

    However, it's not consistent. Refreshing the page a few times (sometimes once, sometimes 12 or so refreshes) will eventually lead to the report working correctly.

    It's a big production environment where we're using StateServer mode and using inProc session state isn't possible. It happens on our dev machines when we're using local IIS as well as our test server.

  2. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 15 Apr 2015 Link to this post

    Hello Corin,

    In general, when you use out-proc session state mode, there are specific rules which all reports must follow - Design Considerations for Out-proc Session State. Reports are serializable, thus check if there is a setting applied before displaying them, which cannot be serialized.

    On a side note, the rules for out-proc session state mode apply when you use the ASP.NET WebForms ReportVIewer, which relies on the ASP.NET Session to preserve the state of the currently displayed report. Our recommendation is to switch to the new HTML5 Report VIewer, which uses custom storage (not the ASP.NET Session) for the report's resources and provides more styling options as it is a client-side HTML5/CSS3/JS widget, served by a running Reporting REST service. For more details, please check  this forum thread and the linked overview articles.



    I hope the provided information is helpful.

    Regards,
    Stef
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top