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 = newReportDocument();
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