I need to pass values into parameters using the Crystal controls as follows:
Report.ParameterFields(1).AddCurrentValue ("Wednesday")
Report.ParameterFields(2).AddCurrentValue Val(Text2)
Report.ParameterFields(3).AddCurrentValue (0)
Report.ParameterFields(4).AddCurrentValue ("")
Which is fine if the report requires 4 parameters. If the report only needs 3 then if the order of the parameters is incorrect then the project falls over.
So I'm thinking I need to find the parameter field name so I can set a value accordingly.
I'm thinking a select case statement:
'This is just air code.............
Select Case report.parameterfields.name
case1 "DayID"
Report.ParameterFields(1).AddCurrentValue ("Wednesday")
case2 "Amount"
Report.ParameterFields(2).AddCurrentValue Val(Text2)
end select
Does anyone have any experience with the Crystal controls to help me out ?
Regards
Parameter Fields, Crystal Reports
-
- SilverLounger
- Posts: 1728
- Joined: 25 Jan 2010, 08:34
- Location: Stoke on Trent - Staffordshire - England
Parameter Fields, Crystal Reports
Cheers ...
Dave.
Dave.
-
- Administrator
- Posts: 78558
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Parameter Fields, Crystal Reports
Try
Report.ParameterFields.GetItemByName("DayID").AddCurrentValue "Wednesday"
Report.ParameterFields.GetItemByName("Amount").AddCurrentValue Val(Text2)
etc.
Report.ParameterFields.GetItemByName("DayID").AddCurrentValue "Wednesday"
Report.ParameterFields.GetItemByName("Amount").AddCurrentValue Val(Text2)
etc.
Best wishes,
Hans
Hans
-
- SilverLounger
- Posts: 1728
- Joined: 25 Jan 2010, 08:34
- Location: Stoke on Trent - Staffordshire - England
Re: Parameter Fields, Crystal Reports
Hi Hans, great stuff.
I'm getting Error: method or data not found with [.GetItemByName] although I've registered CRAXDRT.dll ??
Have you tested the lines of code? or any thoughts on this?
Regards
I'm getting Error: method or data not found with [.GetItemByName] although I've registered CRAXDRT.dll ??
Have you tested the lines of code? or any thoughts on this?
Regards
Cheers ...
Dave.
Dave.
-
- Administrator
- Posts: 78558
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Parameter Fields, Crystal Reports
Hi Dave,
It was just something I found by Googling. I don't have Crystal Reports myself, so I have no idea what would be needed. Sorry.
It was just something I found by Googling. I don't have Crystal Reports myself, so I have no idea what would be needed. Sorry.
Best wishes,
Hans
Hans
-
- SilverLounger
- Posts: 1728
- Joined: 25 Jan 2010, 08:34
- Location: Stoke on Trent - Staffordshire - England
Re: Parameter Fields, Crystal Reports
I did the same, I'll find a way as I always do.... lol
Cheers ...
Dave.
Dave.