Skip to Content
author's profile photo Former Member
Former Member

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

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 and Visual Studio 2010 with .Net framework 4.5 on Windows 7, 64bit.

cryRpt = new ReportDocument();


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?



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jan 07, 2014 at 01:54 PM

    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:

    SAP Crystal Reports, developer version for Microsoft Visual Studio: Updates & Runtime Downloads

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


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.