mhertzfeld / CrystalReportsNinja

A fork of a small Windows Console App that loads and executes Crystal Reports, exporting the results to a variety of supported file formats, email or printed. This fork includes numerous features and fixes that are not a part of the forked project.
26 stars 19 forks source link

MultiValue Parameter #32

Closed mammbo3 closed 4 years ago

mammbo3 commented 4 years ago

I have a report that works fine if a value is set to be a single value. However, I change the value to a Multivalue, CR Ninja gives an error. I tried installing 1.0.7 and the error is still there.

First, the command I am trying to use: C:\CrystalReportNinja\CrystalReportsNinja.exe -U <user> -P <pw> -S <server> -F V:\HCCLibraryLoad.rpt -a "Term:20204|20203" -O W:\LibraryUserlist\LibraryUser-<date> -E tab

This is the error I am getting (Also looks like you have a typo below?: DB logion): 04-09-2020 16:01:36 04-09-2020 16:01:36 ================== LoadReport, Output File and DB logion =========== 04-09-2020 16:01:37 Report HCCLibraryLoad.rpt loaded successfully 04-09-2020 16:01:37 Output Filename : W:\LibraryUserlist\HCCLibrary-20200904.txt 04-09-2020 16:01:37 Output Format : tab 04-09-2020 16:01:40 Logged into Database on <SERVER> successfully with User id: <USERID> 04-09-2020 16:01:40 04-09-2020 16:01:40 ================== ProcessParameters =============================== 04-09-2020 16:01:40 Number of Parameters detected in the report = 1 04-09-2020 16:01:40 Number of Parameters passed by the users script = 1 04-09-2020 16:01:40 04-09-2020 16:01:40 Applied Parameter 'Term' as MultiValue 'True' 04-09-2020 16:01:40 Discrete Parameter : Term = 20203 04-09-2020 16:01:40 Multiple Value Parameter - Prompt = Please select a term - Term = 20203|20204 04-09-2020 16:01:40 Discrete Parameter : Term = 20204 04-09-2020 16:01:40 Multiple Value Parameter - Prompt = Please select a term - Term = 20203|20204 04-09-2020 16:01:40 04-09-2020 16:01:40 04-09-2020 16:01:40 ================== STEP = PerformOutput ============================ 04-09-2020 16:01:41 04-09-2020 16:01:41 ===================Logs and Errors ================================= 04-09-2020 16:01:41 Message: Failed to open the connection. HCCLibraryLoad 10660_5060_{CBEBB704-741C-442B-A692-10AC6E7764AA}.rpt 04-09-2020 16:01:41 HResult: -2147221760 04-09-2020 16:01:41 Data: System.Collections.ListDictionaryInternal 04-09-2020 16:01:41 Inner Exception: System.Runtime.InteropServices.COMException (0x800002F4): Failed to open the connection. HCCLibraryLoad 10660_5060_{CBEBB704-741C-442B-A692-10AC6E7764AA}.rpt at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) 04-09-2020 16:01:41 StackTrace: at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e) 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.FormatEngine.Export() at CrystalDecisions.CrystalReports.Engine.ReportDocument.Export() at CrystalReportsNinja.ReportProcessor.PerformOutput() at CrystalReportsNinja.ReportProcessor.Run() 04-09-2020 16:01:41 ==================================================================== I have unchecked the option to save data with report. Let me know if you need more information. Thanks!

fabian-sta commented 4 years ago

You haven't specified your Database Name -D ??? in the query above

mammbo3 commented 4 years ago

I have a few other reports that CRN generates reports for. I do not use the DB name and they work fine. I have added the -D switch with database name as requested and I still get the same error as above.

fabian-sta commented 4 years ago

What Database are you connecting to MS SQL, My SQL ??

mammbo3 commented 4 years ago

Oracle 11.2 through ODBC

fabian-sta commented 4 years ago

Its a weird one as the log shows its failing to connect . Make sure you have the 32/64 bit odbc drivers for it .Try it with just one value .does it have any subreports??

mammbo3 commented 4 years ago

32 bit odbc drivers and CR Ninja are installed. No Subreports However, the value is a multi-value parameter. If I was to modify the value to only accept a single value in Crystal Reports (and change my parameters for CR Ninja to be something like -a "Term:20204" then the report loads no problem in CR Ninja.

mammbo3 commented 4 years ago

Hmmm.....It was working with a single value parameter. That does not seem to be the case any more. Getting above error now. Trying to investigate more. I have other reports from the same DB that work fine....

mammbo3 commented 4 years ago

I am going to close this issue for now. All of a sudden it started working without an issue. Not sure what fixed my connection issue.

Thank you for your help once again.