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
93 stars 77 forks source link

One date range parameter generates the report. Another returns 'incorrect log on parameters'. #64

Open GHExplorer opened 1 year ago

GHExplorer commented 1 year ago

This is for Crystal 2013.

I ran a query last month, for the date range July 1st, 2022 through July 31st, 2022. That query still works.

But when I change the date range, it returns incorrect log on parameters.

CrystalReportsNinja.exe -S DB -U USERID -P PW -F MY_Summary_Report.rpt -E xls -O MY_Summary_Report -a BEG_DT:07-01-2022 -a END_DT:07-31-2022 Report loaded successfully Database Login done Completed

CrystalReportsNinja.exe -S DB -U USERID -P PW -F MY_Summary_Report.rpt -E xls -O MY_Summary_Report -a BEG_DT:08-01-2022 -a END_DT:08-31-2022 Report loaded successfully Database Login done Error in File MY_Summary_Report 9999999999{E4....}.rpt: Unable to connect: incorrect log on parameters. Error in File MY_Summary_Report 9999999999{E4....}.rpt: Unable to connect: incorrect log on parameters. at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)

There IS a way to use an August date range - by refreshing the Prompt Parameters in the Report with an August range, and then saving the report. Then the runtime with CrystalReportsNinja works without an error, using August. But if I try any other range, other than the one saved with the report, it returns the "incorrect log on parameters" error.

sunk818 commented 1 year ago

I could be totally wrong, but I vaguely recall with the previous iteration (crexport), there were issues with reports that had saved data conflicting with queries. Now, I couldn't tell how you clear data off of a saved report, but if you could save the report without the date range filled in, maybe that is another option for you to explore.

GHExplorer commented 1 year ago

That didn't occur to me. Ok, thanks sunk818, will give it a try. Up to now, I've just been refreshing manually and generating from Crystal.