General information
Category:
Third party products
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only