In SSRS 2008, I use Multi-value parameters to, well, select multiple values for a particular parameter.
In my report I have conditional formatting: a particular label has to be blue if the item is selected; otherwise it will stay black. My intuition was trying it the SQL way - but I was wrong :-)
Switch( Fields!groupType.Value = "firstValue", "#00ffffff", Fields!groepType.Value = "secondValue", "Tomato", Fields!groepType.Value = "thirdValue", "DimGray", Fields!groepType.Value IN Parameters!p_myMultipleValueParameter.Values, "Blue" )
What is the right way to handle this?
Setting default values for multi-value parameters If we want to set Select All option as a default parameter we need to follow the steps below: Choose Get values from a query under the Default Values tab. Set HRReportParameterDataset into the Dataset Combobox.
A multivalue parameter allows the user to select more than one value for the parameter from a list of available values. When you define a list of available values for a multivalue parameter, a <select all> option is automatically added to the list of values in the report parameter editor.
In the Report Data pane, expand the Parameters node, right-click the report parameter that was automatically created for the dataset parameter, and then click Parameter Properties. In the General tab, select Allow multiple values to allow a user to select more than one value for the parameter.
I think the cleanest way is probably the following
Array.IndexOf(Parameters!p_myMultipleValueParameter.Value, Fields!groepType.Value) > -1
Running a join each time may be inefficient because of the overhead of allocating extra strings, especially if the function will be run over a large list, or once per row of a grid, say.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With