cancel
Showing results for 
Search instead for 
Did you mean: 

passing serialized xml to crystal for distributed c# app

Former Member
0 Kudos

I am new to Crystal reports and I am investigating a Visual Studio 2008 .NET C# solution for my WPF application. I would like to create a dll that holds all of the Crystal rpts and schema and simply invoke a function calling a specific report with the data serialized to xml string. The output should be a PDF file. I would like to have this library be referenced in any of my applications to allow my application to call by initializing and calling the functuon passing in these two parameters. I also do not want to include anything in the GAC because I simply want no deployment issues using OneClick.

I would appreciate it any adivce in this area.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I wrote and deployed the web service and it is working fine. There is only one problem. It takes forever to initialize. I suspect it is taking awile for Crystal to load. any ideas?

former_member208657
Active Contributor
0 Kudos

Be more specific. How long is forever to you? 10 seconds? 30 seconds? 5 minutes?

If this is a long running report then it is very possible for this to export completely to PDF format. You'll want to run this report in the Crystal Reports designer and export it to PDF format. That will give you a benchmark to compare to. We won't guarantee that the Crystal Reports .NET engine will do it just as fast, but you'll at least know what to expect when exporting via your web service.

How large is the PDF file that you are producing?

How long does it take to execute the Export() method in the web service? You can add some logging code to find out.

Answers (2)

Answers (2)

Former Member
0 Kudos

I implemented a call to a web service that creates a PDF on the box and sends a byte[] array back to the calling client of the PDF. Everything works fine but the service alwasys seems to die after the 10th iteration.

Any ideas as to why this is happening. I am using 2008...

former_member208657
Active Contributor
0 Kudos

If it works a few times then dies after 10 then I suspect you are not writing any cleanup code for your ReportDocument. If you don't use the ReportDocument.Close() and Dispose() methods your print jobs and database connections will be left open. This can cause problems when running multiple jobs at the same time, or in a sequence.

former_member200290
Contributor
0 Kudos

You may also want to use try-catch and then log the error message caught to figure out the exact error message.

former_member200290
Contributor
0 Kudos

Hello bqsoftware,

For the most part there should be no issue with this. There are tons of code samples on our site, and all over the web, not necessarily doing this but showing bits and peices. You just need to put them together. You can start at https://www.sdn.sap.com/irj/boc/samples.

Firstly putting the reports into your own dll assembly will not be an issue. Putting the serialized XML string directly is something you can't do directly, you would need to convert it back into an ADO .NET Data table or Data Set then you can pass it to your report parameter using the .SetDataSource method.

As for not placing your dll into the assembly directory that is not an issue, as long as you know how to load your own assembly. The however on this is that our Crystal DLL will need to be put into the assembly directory. We do have a click once deployment that will deploy our assemblies and other dlls, such as COM registerable ones.

The alternatives is to host the dll that performs the reporting on your own web server as a webservice. Your WPF application could easily consume the webservice then return back the PDF file.Your DLL and the Crystal Runtime would not need to be destributed then, however the end-users would require an internet connection and your webserver would need to handle the load.

Trevor