Skip to Content
0
Former Member
May 18, 2010 at 07:42 PM

CrystalReportViewer SerializationException when saving to session.

133 Views

Hello, according to the ViewReportParameter code example (ENTXI_csnet_rpt_ViewReportParameter) the InfoObject is save to session so that it can be reset to the reportsource of the CrystalReportViewer on a postback. This is a subset of the code:

....

InfoObject ceReportObject;

....

//place the report object in session for use with postbacks

Session.Add("ReportSource", ceReportObject);

I have been unable to set the ceReportObject to session because it is not serializable. I get the following exception:

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.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

I am using the ASP.NET native state server for the session. Is there someway I can get around this exception?

Any ideas would be appreciated.

Thanks

Coleen