473,378 Members | 1,469 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 1513

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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.