rainforestnet / CrystalReportsNinja

A small Windows Console App that loads external Crystal Reports file, takes parameter inputs and export to various format or even print to printer
http://www.rainforestnet.com
96 stars 79 forks source link

Exception on report load #7

Open Hitamashi opened 7 years ago

Hitamashi commented 7 years ago

Hello,

I cannot run my command:

CrystalReportsNinja.exe -F LeaveNotification_FromSV.rpt -O result.pdf -E pdf

It always returns this exception.

Exception: Load report failed.
Inner Exception: System.Runtime.InteropServices.COMException (0x80041811): Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack.
   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()

I am sure that there is no process open the report. I also checked the permissions (read&write), run as administrator.

I have checked with other reports. The problem is the same.

Try passing a "hardcode" parameter in the source code but it still not work.

Could you please help me with this problem?

Thanks in advance

mhertzfeld commented 7 years ago

Do you have the correct Crystal Runtimes installed? I think I've seen that error before when the runtimes I had installed were a lower version than what the app was compiled for. I would uninstall the runtime(s) you have installed currently and get then get the latest from SAP.

Hitamashi commented 7 years ago

Thank you. But I have tried both version 13.0.20 and 13.0.21 of the Crystal Runtimes. Nothing works for me. For more info, I have tried the command on Windows 10 and Windows Server 2008 R2.

mhertzfeld commented 6 years ago

OK. Pretty sure that's the error I've gotten before when the versions were mismatched.

Try my fork of the project to see if it works for you. https://github.com/mhertzfeld/CrystalReportsNinja

Before you do though make sure to uninstall all crystal reports runtimes you have installed and reinstall 13.0.21.

ancelP commented 6 years ago

hi, i encountered exception like this. ninja-20180327160210.log

27-03-2018 16:02:13 Report loaded successfully 27-03-2018 16:02:13 Output Filename : test2.pdf 27-03-2018 16:02:13 Output format : pdf 27-03-2018 16:02:14 Discrete Parameter : PV_FOR_DATE = 2018-03-26 27-03-2018 16:02:16 Exception: Error in File 0151 2244412724{8A3B3C0E-029C-48E8-9949-6EAD2B25DCD9}.rpt: Failed to load database information. 27-03-2018 16:02:16 Inner Exception: System.Runtime.InteropServices.COMException (0x800002CD): Error in File 0151 2244412724{8A3B3C0E-029C-48E8-9949-6EAD2B25DCD9}.rpt: Failed to load database information. at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)

by the way, your fork worked for me. ;)