470,810 Members | 888 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,810 developers. It's quick & easy.

Returning a Crystal ReportDocument

Hello

Is it possible to return a Crystal ReportDocument from a WebService?

I keep getting the following error:

Exception: System.Web.Services.Protocols.SoapException: Server was unable
to process request. ---System.InvalidOperationException: There was an error
generating the XML document. ---System.InvalidOperationException: The type
CrystalDecisions.CrystalReports.Engine.ReportDocum ent was not expected. Use
the XmlInclude or SoapInclude attribute to specify types that are not known
statically.
at
System.Xml.Serialization.XmlSerializationWriter.Wr iteTypedPrimitive(String
name, String ns, Object o, Boolean xsiType)
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationWriter1.Write1_Object(String n, String ns, Object o, Boolean isNullable, Boolean needType)
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationWriter1.Write13_GetReportResponse(Obje ct[] p)
at
Microsoft.Xml.Serialization.GeneratedAssembly.Arra yOfObjectSerializer21.Serialize(Object objectToSerialize, XmlSerializationWriter writer)
at System.Xml.Serialization.XmlSerializer.Serialize(X mlWriter xmlWriter,
Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlSerializer.Serialize(X mlWriter xmlWriter,
Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
at System.Xml.Serialization.XmlSerializer.Serialize(X mlWriter xmlWriter,
Object o, XmlSerializerNamespaces namespaces, String encodingStyle)
at System.Web.Services.Protocols.SoapServerProtocol.W riteReturns(Object[]
returnValues, Stream outputStream)
at System.Web.Services.Protocols.WebServiceHandler.Wr iteReturns(Object[]
returnValues)
at System.Web.Services.Protocols.WebServiceHandler.In voke()
--- End of inner exception stack trace ---

Method: ReadResponse

How would I use the XmlInclude or SoapInclude? The following is the coee
for the WebMethod:

<WebMethod()_
Public Function GetReport(ByVal strDB_Locale As String, _
ByVal dsReportInfo As System.Data.DataSet, _
ByRef crReport As Object, _
ByRef strMessage As String, _
ByRef strDetailedMessage As String) As Boolean

'************************************************* ************************************************** *******************
'
' Procedure: GetReport
'
' Description: This WebMethod accepts a dataset with report parameters
'
' Parameters:
' strDB_Locale: Database locale (LOCAL or REMOTE)
' dsReportInfo: DataSet containing report parameters
' crReport: Crystal Report Document
' strMessage: Exception message or other user feedback
' strDetailedMessage: Detailed exception message or other user feedback
'
' Return Value: True/False identifying whether report creation was
successful
'

'************************************************* ************************************************** *******************

Dim clsReporting As New Reporting(strDB_Locale.ToUpper)
'Class object to process login request

'Begin structured error handling "Try" block
Try

'Execute "GetReport" method to process report request
Return clsReporting.GetReport(dsReportInfo, _
crReport, _
strMessage, _
strDetailedMessage)

Catch ex As Exception

'Concatenate existing message with exception message
strMessage = String.Concat(strMessage, ControlChars.CrLf,
ControlChars.CrLf, ex.Message)
'Concatenate existing detailed message with detailed exception message
strDetailedMessage = String.Concat(strDetailedMessage,
ControlChars.CrLf, ControlChars.CrLf, ex.StackTrace)

Finally

Try

'Release objects for disposal
clsReporting.Dispose()

Catch ex As Exception

End Try

'Release objects for disposal
clsReporting = Nothing

End Try

End Function
All help would be greatly appreciated.

Thanks
Tom
Aug 21 '06 #1
0 1393

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Stephan | last post: by
reply views Thread by =?Utf-8?B?QmFkaXM=?= | last post: by
1 post views Thread by pupilstuff | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.