Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing multiple values to a parameter field

Status
Not open for further replies.

swetham

Programmer
May 5, 2010
257
DE
My reprot has week parameter where user can select more than one week (multiple weeks can be entered), i wrote the below code,

Dim crParameterDiscreteValue As ParameterDiscreteValue
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldLocation As ParameterFieldDefinition
Dim crParameterValues As ParameterValues

Dim crParameterFieldDefinition As ParameterFieldDefinition
crParameterFieldDefinitions = cryrpt.DataDefinition.ParameterFields

crParameterFieldDefinition = crParameterFieldDefinitions("Week")

crParameterValues = crParameterFieldDefinition.CurrentValues

crParameterDiscreteValue = New ParameterDiscreteValue()
crParameterDiscreteValue.Value = "18" '1st current value

crParameterValues.Add(crParameterDiscreteValue)


'crParameterDiscreteValue = Nothing
crParameterDiscreteValue = New ParameterDiscreteValue()
crParameterDiscreteValue.Value = "17" '2nd current value

crParameterValues.Add(crParameterDiscreteValue)

crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

'crParameterFieldLocation.ApplyCurrentValues(crParameterValues)

But the report is showing only records in week 17 only. whatever value i am assigning in the last it is only getting passed. Can anyone please help me?
 
Not a programmer but your first line appears to be the cause

Dim crParameterDiscreteValue As ParameterDiscreteValue

Discrete value parameters can only old a single value, you need to define a multiple value, no idea how you do that, but would guess at

Dim crParameterMultipleValue As ParameterMultipleValue

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top