472,984 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,984 software developers and data experts.

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 1487

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
2
by: tc | last post by:
hi all, I would like to know how to export a cyrstal report to pdf by using the crystal report viewer without prompt up a dialog for user to enter the file name, i.e. I want to place the file...
0
by: stephan | last post by:
I know that this has been beaten to death but I can't seem to resolve my issues (I have 2 of them). I have created a class that exposes a public method which returns a datatable as a datasource...
19
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set...
3
by: LataChavan | last post by:
I have tried to look for a solution to the problem of sending parameters to stored procedures through crystal report. Following is the code: Now what happens is that if i do not apply the logon...
1
by: Rodo | last post by:
Hi all, I'm trying to generate a simple crystal report without a database. Several people mention the use of a dataset. Someone mention in a msdn forum that I could use the SetParameterValue to...
0
by: =?Utf-8?B?QmFkaXM=?= | last post by:
Hi, I'm using this code to run a crystal report and export it to pdf, and when running it it in debug mode it working fine, but from the browser it's fails to run telling me that the Crystal...
0
by: mknoll217 | last post by:
Hello. I have been trying to log onto two databases at run time for a crystal report. I have tried both the crystal report viewer and the report document object viewer. I have no figured out a way to...
1
by: pupilstuff | last post by:
hi guys i wan to make dyanmic crystal report according to values which i checked from check box thats all i did 1. I made data set having data table name "Customer" 2 i put four columm id,name...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.