[Migrated content. Thread originally posted on 08 July 2008]
Hey All,I've got a crystal reports 11 report that takes a date parameter. It's a report over vision data and I've set the date directive on the date field in my fd. When I attempt to pass a date from my acucobol program to the report using the setcurrentvalue method, I get a type mismatch error. Anybody have any luck sending date values to a report? If so, how did you format it?
Here's some sample code I'm using (most of it gotten from this forum!):
copy "craxdrt11.def".
...
77 crystal-app handle of application.
77 crystal-rpt handle of report.
77 crystal-params handle of ParameterfieldDefinitions.
77 crystal-param handle of ParameterFieldDefinition.
....
inquire Crystal-Rpt, ParameterFields in crystal-params.
modify crystal-params, getitembyname("WODate"), giving crystal-param.
modify crystal-param setcurrentvalue(by name CurrentValue is "{d '2008-07-07'}" ).
I've tried several different variations like "20080707", "Aug 7, 2008". The above example works with winsql. I could always remove the date directive from the fd and then send a numeric value. It's nice not having to format the date in a report by using the date directive though.
Thanks in advance,
Clay



