Hi All,
Following is the scenario i am working on.
1. There are some .RPT files which reside on server.
2. Client will request to see the report, in that case RPT file will
be dynamically loaded on server , dataset is passed as datasource to
report and then that report is streamed to client using
ExportToStream method.
3. Client will receive this stream and reconstruct Report Document
and will display in viewer.
4. Client Server communication is mentained using .Net remoting.
Everything works fine in stand alone mode. Problem is in remoting
mode.
Problem occurs at the time of loading report file dynamically,
following is the exception i get.
The type
CrystalDecisions.CrystalReports.Engine.LoadSaveReportException in
Assembly CrystalDecisions.Shared, Version=9.1.5000.0,
Culture=neutral, PublicKeyToken=692fbea5521e1304 is not marked as
serializable.
Server stack trace:
at
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSe
rialize(Object obj, ISurrogateSelector surrogateSelector,
StreamingContext context, SerObjectInfoInit serObjectInfoInit,
IFormatterConverter converter)
at
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serial
ize(Object obj, ISurrogateSelector surrogateSelector,
StreamingContext context, SerObjectInfoInit serObjectInfoInit,
IFormatterConverter converter)
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize
(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean
fCheck)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serial
ize(Stream serializationStream, Object graph, Header[] headers,
Boolean fCheck)
at
System.Runtime.Remoting.Channels.BinaryServerFormatterSink.SerializeR
esponse(IServerResponseChannelSinkStack sinkStack, IMessage msg,
ITransportHeaders& headers, Stream& stream)
at
System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMes
sage(IServerChannelSinkStack sinkStack, IMessage requestMsg,
ITransportHeaders requestHeaders, Stream requestStream, IMessage&
responseMsg, ITransportHeaders& responseHeaders, Stream&
responseStream)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage
(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke
(MessageData& msgData, Int32 type)
at Hebron.Common.Interfaces.IFeesReportController.GetInvoice
(ArrayList oArrylst)
at Hebron.ReportClient.ReportTool.PrintReport(ReportName name,
ArrayList oArry)
at Hebron.FeesClient.ReviewInvoices.btnPrint_Click(Object sender,
EventArgs e)Normally if an object is serializable then you can just add an attribute [serialziable] to your class and it works.
Crystal Report Document Object is not Serializable as per the Business Object documentation(atleast till version 10). During remoting the object needs to be serialized and that is why you get the error. Try to find out from Business Objects support team if you can, at all serialize the object ? Will face the same issue if using ASP.NET "StateServer" session and try to save the Report Document object in session.
Frank
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment