Sunday, March 11, 2012

Displaying Multi-valued parameters

Hi There.

I am struggling with an issue with multi-valued parameters. I have a parameter that is a list of several hundred items and when someone selects all of them, I display the huge list in the report header vias the join command.

This works great for a few parameters, but overwrites my data when the list is large. I want to do something in the expression where I determine if all items are selected and then just display 'All' instead of the whole list. Any ideas would be very helpful!

Thanks, Mike

see this code from msdn, modify it to suit your need, if parameter.Value(i) <> " " then increase a counter value, at the end check if counter = total count in parameter then display all

to call the function in the expression

=Code. ShowParameterValues(Parameter!SomePara)

hope this helps

Public Function ShowParameterValues(ByVal parameter as Parameter)
as String
Dim s as String
If parameter.IsMultiValue then
s = "Multivalue: "
For i as integer = 0 to parameter.Count-1
s = s + CStr(parameter.Value(i)) + " "
Next
Else
s = "Single value: " + CStr(parameter.Value)
End If
Return s
End Function

|||

Thanks for the guidance Yashant!

I have not done custom code in a report. I think the

=Code. ShowParameterValues(Parameter!SomePara)

goes in the expression of the textbox correct?

Where does the function go? Is it under the report properties code tab?

Thanks, Mike

|||yes, the expression goes into the text box and code goes in reports properties code tab. you need to modify the code to work for you.

No comments:

Post a Comment