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:
00657114
Views:
39
Hi Randy,

I have gotten it to work somewhat.

loCrRpt.ParameterFields.Item(1).SetDefaultValue("01")

Sets the value. However When I issue a
loCrRpt.ParameterFields.Item(1).SetCurrentValue([TRUE])

This according to the Developers help is supposed to keep the Parameter Value Window from Popping up and it doesnt. Any Idea how to stop that?
Other than using the EnableParameterPrompting value. If I set that to .F. then I don't get any data even though I set the default value to "01"

Ron



>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
Ronald L. Thorp
http://www.Fox-Pros.com
Fox-Pros, Inc.
Office 407-498-0100
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform