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

Date parameters give exception #32

Open dataclear opened 5 years ago

dataclear commented 5 years ago

Launching the executable with the arguments as follows:

CrystalReportsNinja.exe -F "TestRep.rpt" -O "report-1101.pdf" -E "pdf" -l -a "StartDate:(2018-09-01)" -a "EndDate:(2018-09-02)"

Gives me the exception error:

The types of the parameter field and parameter field current values are not compatible.

I've tried several formats for the dates; "YYYYMMDD", "DDMMYYYY", "DD/MM/YY" to no avail. Changing the parameter types from Date to String removes the error.

Does this mean that CRN supports only string parameters?

mhertzfeld commented 5 years ago

I use dates all of the time as parameters.

Make sure that the names used for the parameters in crystal match what you are passing into the parameters. Also, I've never surrounded my dates with ( ), that could be part of your problem too.

Mine typically look like "StartDate:20180901" or "@StartDate:20180901"