Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any Crystal Report Gurus?
Message
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
00657026
Message ID:
00657069
Views:
29
I just started working with parameter passing and using data sources other than Fox2x type tables, but I believe the issue you are running into is because the apremeter fields array is 1 based, not zero-based. IE, the first parameter field in your report is .ParameterFields(1). I haven't tried it your way, but what I got to work with setting a parameter value is by using the AddCurrentValue method:

loCrRpt.ParameterFields(1).AddCurrentValue(MyValue)

If only the Crystal Developer docs weren't so stinky. After a bit of poking on the CrystalDecisions web site I finally found a reference to doing this (in VB of course) and got it to work.

HTH,
Randy

>I am working with Crystal Reports 6.0
>
>I create an Object for CR and open the report but I need to set the First
>Parameter to "01"
>
>Does anyone know how to do this?
>
>This is what I have so far...
>
>* Create the CR Object
>loCr = CREATEOBJECT("CrystalRuntime.Application")
>
>* Open the report
>loCrRpt = loCr.OpenReport("C:\Foxpro\Fss\Reports\Statistics.Rpt")
>
>* Set the data location
>loCrData = loCrRpt.Database
>loCrTables = loCrData.Tables
>loCrTables.Item(1).Location = "C:\Scratch\Stat.DBF"
>
>According to the Help file the usage is like this.
>Report.ParameterFields(ArrayIndex)[=ParameterName;NewValue;SetCurrentValue]
>
>For example, to change the value of the first parameter field in a report
>(parameter1) to red use the following syntax (user will not be prompted to
>enter a value):
>
>CrystalReport1.ParameterFields(0) = parameter1;red;TRUE
>
>
>
>I can not get this to work...
>loCrRpt.ParameterFields(0) = [parameter1;01;TRUE]
>
> Any help would be appreciated,
>Ron
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform