Highlighted
Absent Member.
Absent Member.
393 views

[archive] Crystal Report Parameter

[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
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Crystal Report Parameter

I found an example that set this as a string, however what to set to a string is an open question.
I figure you are doing the right thing, it is just the content in your string that is wrong.
When I checked a def file I had, it is just stating that the parameter is a variant.
Without any documentation of the property/method and an example from another language it is hard to tell.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Crystal Report Parameter

I found another reference suggesting that the field is expecting a VT-DATE type variant. Unfortunately this variant type is not currently supported by ACUCOBOL-GT, so if this is the case you will have to contact Tech Support and file an enhancement request.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.