Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

Preventing ExportToDisk from crashing the service

$
0
0

Hi All:

 

Here we've built a report service that processes crystal report -> PDF requests by users.  Lately we've been having issue with some of the complex reports and the ExportToDisk method just crashes the service.  We got to the bottom of the actual issue and was able to fix the report(bad formula) but is there anything I can do to handle the exception more gracefully?  Currently the host service just stops and we have to manually restart the service.

 

I create a small test app to try to solve the problem, start with just a simple Try Catch.  When the error occurs the test app just dies instead of going into the Catch.

 

Can anyone suggest what I should do?  I fixed one of the reports but there are some that are still causing problem.  I am hoping that I can at least keep the host process up and running when the export fails.

 

Try

            

ReportDocument.EnableEventLog(EventLogLevel.LogCRPEAPIErrors)

 

crystal.ExportToDisk(CrystalDecisions.Shared.

ExportFormatType.PortableDocFormat, "test.pdf")

 

Catch

  

Debug.WriteLine("Exception...")

        

EndTry


Viewing all articles
Browse latest Browse all 3636

Trending Articles