Skip to Content
0

How to Handle all type exception from crystal report?

Mar 28 at 03:09 PM

147

avatar image

I have a c# web and windows application, which uses crystal report for generating report.

We have a situation such that the applications crashes while we trying to export to disk with a dialogue box vshost32.exe stopped working, even though we have implemented exception handling we are not able to get or catch the exception.

I found that the crystal report is causing the error by looking at the system log.

Is there any way that we can catch all the crystal report errors or excepetion from c# code?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

8 Answers

Don Williams
Mar 28 at 10:16 PM
0

Wrap all functions in a try/catch block and in the catch add something like this:

catch (Exception ex)
{
if (ex.Message.ToString() == "Load report failed.")
{
MessageBox.Show("ERROR: Load report failed: " + ex.InnerException.Message.ToString());

Also, in the Viewer there are all sorts of event handlers you can add code to.

Don

Share
10 |10000 characters needed characters left characters exceeded
shahabas sageer Mar 30 at 05:19 AM
0

Hello Don Williams, i have already implemented this but the application crashes without throwing an exception also i tried various other ways to handle this, I need to know if we can avoid application from crashing.

Since i got to know crystal report is causing the error i was thinking if there is any way we can handle this issue in the code.

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Apr 03 at 03:12 PM
0

Use DebugDiag and see if it capture what CR component, or not, is generating the exception.

Also, try running VS and your app under the Admin account by right clicking on the EXE's and selecting run as Administrator.

It may be access permission issue.

ProcessMonitor may show you what dll is generating the error.

Don

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Don Williams Thank you for your response. We have installed applications which you have told and we are checking on this.

We have checked the event viewer, and found the following error in the log. Will it be helpful for you to analyze the actual issue?

Faulting application name: ReportApp.exe, version: 1.0.1705.1, time stamp: 0x5a8d2727
Faulting module name: crpe32.dll, version: 13.0.12.1494, time stamp: 0x5443a343
Exception code: 0xc0000005
Fault offset: 0x0032ca2a
Faulting process id: 0xd4fc
Faulting application start time: 0x01d3ba39e4c4e89a
Faulting application path: C:\Program Files (x86)\ReportApp\ReportApp.exe
Faulting module path: C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\crpe32.dll
Report Id: 291c8194-262d-11e8-80e5-0cc47a9b8aeb
Faulting package full name: 
Faulting package-relative application ID: 


Application: ReportApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: exception code c0000005, exception address 37B5CA2A


0
Don Williams
Apr 06 at 01:28 PM
0

No info on the work flow or what is happening when the error happens so not much to suggest other than you need to do more debugging. Add logging to your app.

Windows can't defrag memory and CR needs contiguous blocks of memory so try cycling IIS every 12 hours and see if that helps.

Don

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Apr 05 at 04:04 PM
0

You are using SP 12 -

version: 13.0.12.1494,

Time to upgrade to SP 20 to stay on 2.0 Framework or SP 21 and above to support 3.5 Framework and above.

You can get the installers from here:

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

READ all of the info to upgrade to SP 21 or above.

Check the Platform link also, you may be trying to install onto an unsupported OS.

Don

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hai Don Williams , This issue is a random issue which occurs in some rare scenario.

Will it be an issue of not upgrading the SP?

0

Possibly, without knowing the work flow or what the user was doing before the error it's hard to say what the problem is.

0

Hai Don Williams

Since we have developed our application in VS 2013 with .net framework 4.5 will it be able to install SP21 ?.

Or Is it necessary to upgrade to VS 2015, so that we can install SP21 ?.

0
Don Williams
Apr 12 at 03:27 PM
0

CR for VS supports all version of VS 2010 -> 2017 except Express Versions.

SAP Crystal Reports, Developer Version for Microsoft Visual Studio – Supported Platforms

Don

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Apr 12 at 03:28 PM
0

If it's a random crash I suggest running DebugDiag and capture the crash dump. It may give you an idea of where the issue is.

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Apr 12 at 03:42 PM
0

If it's a random crash I suggest running DebugDiag and capture the crash dump. It may give you an idea of where the issue is.

Share
10 |10000 characters needed characters left characters exceeded