cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to export Report as PDF from Visual Studio 2010 / C#

Former Member
0 Kudos

Dear all

I am trying to create a simple console-based C# application that opens crystal reports and exports them as PDF files. I've found many examples for this on the web but I just can't get it to work. It compiles without errors/warnings but crashes at runtime.

I'm using Crystal Report 11.0.0.1282 and Visual Studio 2010 with .Net framework 4.5 on Windows 7, 64bit.

cryRpt = new ReportDocument();

cryRpt.Load("test.rpt");

Then I get:

System exception: 'COMM_FAILURE'

Reason: error number WSAEINVAL

Completed: no

Minor code: 1330577413 (socket() failed)

If I then try to export the report:

cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat,  "test.pdf");

The program crashes:

System.TypeLoadException: Method 'ISCREditableRTFExportFormatOptions_reserved5' on type 'CrystalDecisions.ReportAppServer.ReportDefModel.EditableRTFExportFormatOptionsClass' from assembly 'CrystalDecisions.ReportAppServer.ReportDefModel, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' is overriding a method that has been overridden.

   at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.DotNetExportOptionsToEromExportOptions(ExportOptions exportOptions)

   at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)

   at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)

   at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)

   at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)

   at Crystal_to_PDF.Program.Main(String[] args) in \\zrh-s107\usersb$\vbfaw\daten\visual studio 2010\Projects\Crystal\Crystal_to_PDF\Program.cs:line 41

Any ideas what might be the problem?

regards

lukas

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Lukas,

CR 11 is not supported any more nor was it ever tested in VS 2010.

Use SP 8, Crystal Reports Developer for Visual Studio 2010/2012 from this link:

First link is the integrator into VS and other ones are the redist packages fro deploying.

Don

Former Member
0 Kudos

I have the same situation as Lukas.  Crystal 11 and Visual Stusio 2010.  I get the same error when trying to export.  I clicked on the link you provided for SP 8 and it continually tells me that the download was interrupted.  Is there another way to get SP 8?

0 Kudos

Try a different Browser.

Don

Former Member
0 Kudos

IE V 9 - interrupted download at 99%

FireFox V 26 - failed - no additional info

Google Chrome V 32.0.1700.107 - failed - network error

Does this support pack fix the issue?

former_member183750
Active Contributor
0 Kudos

I uploaded the install exe for you to the ftp server. If that fails, things are not as they should be on your end. Let me know...

SAP Box Attachment

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

0 Kudos

Hi Leslie,

There are no known issues exporting to PDF in CR for VS 2010 SP8. OK , so there may be the odd one but usually unique issues...

Just a reminder, Crystal Reports is NOT a Database Archiving tool so don't try exporting a years worth of data to PDF, it won't work....

You are/were using an unsupported environment... so no idea why it fails.

Don

Former Member
0 Kudos

I was able to download the install from your FTP server.  Thank you.

Answers (0)