Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to Open the Connection System.Runtime.InteropServices.COMException #56

Open
GHExplorer opened this issue Feb 12, 2021 · 5 comments

Comments

@GHExplorer
Copy link

Hi,

We're trying to deploy this in Prod, and it's working everywhere else. We've tested the exact same command line in multiple environments. Can anyone offer some hints on where to look first?

When we try to generate a PDF, with a command line like

CrystalReportsNinja.exe -S SERVICE -U REPORT_USER -P REPORT_PASSWORD -F OurCrystalReport.rpt -E pdf -O OurCrystalReport -a "BEGIN_DATE:01-28-2021" -a "END_DATE:02-02-2021"

, we get an error:

Report loaded successfully
Database Login done
Failed to open the connection.connection.
OurCrystalReport 2840_1604_{C9XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.rpt
Inner Exception: System.Runtime.InteropServices.COMException (0x800002F4): FaileFailed to open the connection.
OurCrystalReport 2840_1604_{C9XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.rpt
at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)

@GHExplorer
Copy link
Author

This might be related to the difference in odbc drivers, in Prod vs the other environments.

The other environments contain the client drivers (like Oracle in OraClient, etc..)

, whereas Prod has only a generic Microsoft ODBC driver.

Not sure yet. I'm asking someone to install the Oracle cliient drivers in Prod (I'm only allowed to copy files, but cannot update anything in Prod that hits the registry).

@mhertzfeld
Copy link

If you are able to, you may want to try my fork of the project. It has better logging, bug fixes and many more features than the original.

Please read through the documentation on the main page as there may be some differences in the parameters compared to the original version.

https://github.com/mhertzfeld/CrystalReportsNinja

@GHExplorer
Copy link
Author

GHExplorer commented Feb 12, 2021 via email

@BasisOneCO
Copy link

Hello friends,
Using CrystalReportsNinja, When we try to generate a PDF, with a command line like

CrystalReportsNinja -F C:\no_borrar\CrystalNinja1\entrega.rpt -O C:\no_borrar\CrystalNinja1\salida.pdf -E pdf -a "Dockey@:29415" -U SYSTEM -p 1234

I've got an error:

14-03-2021 19:30:31
14-03-2021 19:30:31 ================== LoadReport, Output File and DB logion ===========
14-03-2021 19:30:32 Report entrega.rpt loaded successfully
14-03-2021 19:30:32 Output Filename : C:\no_borrar\CrystalNinja1\salida.pdf
14-03-2021 19:30:32 Output Format : pdf
14-03-2021 19:30:32 Logged into  Database on  successfully with User id: SYSTEM
14-03-2021 19:30:32
14-03-2021 19:30:32 ================== ProcessParameters ===============================
14-03-2021 19:30:32 Number of Parameters detected in the report = 1
14-03-2021 19:30:32 Number of Parameters passed by the users script = 1
14-03-2021 19:30:32
14-03-2021 19:30:32 Applied Parameter 'Dockey@' as MultiValue 'False'
14-03-2021 19:30:32 Discrete Parameter : Dockey@ = 29415
14-03-2021 19:30:32 Single Value Parameter - Prompt = DocKey - Dockey@ = 29415
14-03-2021 19:30:33
14-03-2021 19:30:33
14-03-2021 19:30:33 ================== STEP = PerformOutput ============================
14-03-2021 19:30:33
14-03-2021 19:30:33 ===================Logs and Errors =================================
14-03-2021 19:30:33 Message: No se pudo abrir la conexión.
entrega 19208_53816_{0234DDB5-3B19-47EA-A89D-B6227FF6BC60}.rpt
14-03-2021 19:30:33 HResult: -2147221760
14-03-2021 19:30:33 Data: System.Collections.ListDictionaryInternal
14-03-2021 19:30:33 Inner Exception: System.Runtime.InteropServices.COMException (0x800002F4): No se pudo abrir la conexión.
entrega 19208_53816_{0234DDB5-3B19-47EA-A89D-B6227FF6BC60}.rpt
   en CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
   en CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
14-03-2021 19:30:33 StackTrace:    en CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
   en CrystalDecisions.ReportSource.EromReportSourceBase.HandleException(Exception exception)
   en CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
   en CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
   en CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
   en CrystalDecisions.CrystalReports.Engine.FormatEngine.Export()
   en CrystalDecisions.CrystalReports.Engine.ReportDocument.Export()
   en CrystalReportsNinja.ReportProcessor.PerformOutput()
   en CrystalReportsNinja.ReportProcessor.Run()
14-03-2021 19:30:33 ====================================================================
The database corresponds to a SAP Business One for SAP HANA system, the database route is 192.168.0.202:30015 but I tried using the ODBC DNS, parameter -S"HANA".

Please your help with some hints on how to fix it.

@mhertzfeld
Copy link

@BasisOneCO if you can I would suggest trying my fork to see if you get the same error. This RainForestNet version hasn't been updated in ages.

Most new development and bug fixes are happening in my fork, there are a few of us that are contributing to it.

The parameters may be slightly different and it may require a more recent version of the Crystal Runtimes than you may be using. Read the documentation on the main page.

If you are still having issues when using my fork, please post in the issues under my fork and we will try to help. At this point the RainForestNet version is so far behind I'm not even attempting to troubleshoot.

https://github.com/mhertzfeld/CrystalReportsNinja

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants