cancel
Showing results for 
Search instead for 
Did you mean: 

Export Crystal Report Crash Application from C# 4.0 App. Throw Unhandled exception

Former Member
0 Kudos

Using C# 4.0 Winform Application(32 bit) with Crystal Report 2011 with Crystal report .Net runtime "CRRuntime_32bit_13_0_16".

During exporting report into PDF. An unhandled win32 exception occurred.

A few time this works and next time throw unhandled error as below

Problem signature:

Problem Event Name: APPCRASH

Application Name: Application.vshost.exe

Application Version: 10.0.30319.1

Application Timestamp: 4ba2084b

**Fault Module Name: MSVCR80.dll**

Fault Module Version: 8.0.50727.6229

Fault Module Timestamp: 4ec352ab

Exception Code: c0000005

Exception Offset: 000173c1

OS Version: 6.1.7601.2.1.0.256.48

I am exporting this first then sending the file in mail as attachment.

Then I delete the file after export to pdf process end.

Once this process finished only then user is able to do another process.

The sample code is as below

    if (m_ReportDocument != null)

    m_ReportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, fileName);

    if (!File.Exists(fileName))

    { if (m_ReportDocument != null)

    m_ReportDocument.Dispose();

    return false;

    }

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

That is normal behaviour, The engine is only capable of previewing, exporting or printing one report at a time.

Work around is to spawn a thread for each output type. Or create a CR dll that you can pass a report to to do the job.

Don

Former Member
0 Kudos

I have a separate library(dll) for this function and I have used a separate task to export to pdf as below

System.Threading.Tasks.Task.Factory.StartNew(() => report.SaveToPDF()).Wait();

But the exception still appears.

0 Kudos

Can you export it from CR Designer?

Former Member
0 Kudos

Yes I am able to export this from designer.

This is working a few times.

But sudden one message appear "Access Violation at location ..." when I checked Allow unsafe code in project properties.

I am calling the proper reportDocument.Close() and Dispose() method and then also tried to call

                GC.Collect();

                GC.WaitForPendingFinalizers();

                GC.Collect();

But the final output is a CRASH.

0 Kudos

Run DebugDiag and capture the crash and see what dll it's crashing in.

Don

Former Member
0 Kudos

MSVCR80.dll


Unhandled exception at 0x73f773e8 in ApplicationMenu.exe: 0xC0000005: Access violation reading location 0x162da000.

0 Kudos

Do you have more than one crpe32.dll on that PC? there should only be one and the same version as all of the other CR dll's.

Former Member
0 Kudos

There are three dlls at below location

1. C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\crpe32.dll      version - 13.0.16.1954

2. C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\crpe32.dll  Version - 14.1.7.1853

3. C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64\crpe32.dll                      of        version - 13.0.5.891

Former Member
0 Kudos

I have uninstalled the both runtime 32 bit and 64 bit. Then I installed the 32 bit runtime but no luck favours

Unhandled exception at 0x712f73bd in T.Application.exe: 0xC0000005: Access violation reading location 0x15fc3000.

0 Kudos

Have you installed the MS VS C++ Security runtime update?

http://www.microsoft.com/en-ca/download/details.aspx?id=26347

I'll have to configure a VM Image with those installs and see what happens...

Don

0 Kudos

Make sure you are handling all routines in a try/catch block and see if it catches more info.

It could be you are exporting too much data or some other issue in the report.

Do all reports fail?

Try a 1 page report, set the record selection formula so it filters the excess.

DOn

Former Member
0 Kudos

Yes, I am handling code in a try/catch block. But this crash is not catched and throw unhandled exception.

Sometime this works for same report and sometime fails for same last sucess export. Normally after exporting 1/2 this crash occurs.

Former Member
0 Kudos

Though I did install MS VS C++ Security runtime update,  this is not working.

How you are going to work with VM, please let me know!

0 Kudos

I have Windows and CR 2013 SP 7 as well as VS 2010 and CR for VS SP 17 installed and it's working for me on my new VM-image.

All I can suggest is you use Modules or Process monitor and compare runtime when the crash happens compared to when it doesn't.

Seems to be something in your environment. Try you AV software, add your exe and CR components to the trusted list.

Look in that log for anything also.

Don

DellSC
Active Contributor
0 Kudos

How many rows of data are you trying to export?  Also, what is the selection formula in the Select Expert for the report?  How are you connecting to data - e.g., tables linked together, 1 or more commands, stored procs, etc.?

In addition to Don's thoughts, you might be running into a memory issue if there is a large amount of data or if Crystal has to join or filter any of the data in memory.

-Dell

Former Member
0 Kudos

Hi,

I have added application and crystal reprot in trusted list. But no progress.

I have seen an error in Event Viewer under Administrative Events as below

Event filter with query "SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA "Win32_Processor" AND TargetInstance.LoadPercentage > 99" could not be reactivated in namespace "//./root/CIMV2" because of error 0x80041003. Events cannot be delivered through this filter until the problem is corrected.

0 Kudos

That is a DB error, can you run that query outside of CR?

Answers (1)

Answers (1)

Former Member
0 Kudos

I need to know how to display the report in WinForm, I have used various versions of Crystal previously but with this I'm lost, not

that libraries must be added in reference and type of View control.

Thank you,

            CrystalActiveXReportViewer cr = new CrystalActiveXReportViewer();           

            cr.ReportSource = "X:\\AppCropaExpress_VS2015\\Reportes\\Manifiesto.rpt";           

            cr.ViewReport();

            // control para ver reporte          

            axCR.ReportSource = "X:\\AppCropaExpress_VS2015\\Reportes\\Manifiesto.rpt";

            axCR.ViewReport();

0 Kudos

Hi Antonio,

Code you are using is using the RDC and ActiveX viewer.

Create a new Windows Form project.

Depending on the version of VS set the Project to 4.x Full Framework, not the Client.

On the form click on Tool Bar, add Crystal Reports Viewer to the list by Choose Item....

Framework tab and select CrystalReportsViewer version 13.

Drop the Viewer onto the form and then add the Engine and Shared to start with.

You can just add the viewer and use it to open reports, it has basic abilities.

Search for KBA 2163438 or 2281780, I have attached sample app's for printing or DB and Parameters.

Either one of them will get you going...

Don