Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS Multi Value Parameter. Check whether "Select All" is selected

I have a multi value parameter in my SSRS Report. I want to find out whether (Select All) is checked in that parameter.

In other words, whether all the values in the parameter are checked or only some values are checked.

Is it possible?

I am able to find out number of selected values through Parameters!Parameter.Count. Is there a way to find out total of items in that parameter?

like image 491
Sathya Avatar asked Feb 01 '12 12:02

Sathya


People also ask

How does SSRS deal with multiple valued parameters?

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. Set JobTitle field into the Value field.

How do I use IIF in SSRS expression?

Using IIF Function in SSRS We are going to add a new field to the report data set to determine if the Order Year is the Max or Current Year. As shown below, the dataset properties window is opened, and the Fields tab is selected. After clicking Add, at the bottom of the list a new field is added.

How do you pass one parameter value to another parameter in SSRS?

To set available values for the second parameter In the Report Data pane, in the Parameters folder, right-click the first parameter, and then click Parameter Properties. In Name, verify that the name of the parameter is correct. Click Available Values. Click Get values from a query.


Video Answer


2 Answers

In case anyone is still having issues doing this, I just coded this easy fix.

=IIF(COUNTROWS("dataset").Equals(Parameters!parameter.Count),"it is equal","this is not equal")
like image 61
Merr Leader Avatar answered Sep 20 '22 22:09

Merr Leader


For the specific use-case of showing the selected filter on your report in a textbox, here's the expression that will show "All" if "(Select All)" is selected, otherwise it will show all the selected values as a comma-separated list:

=IIF(
     Parameters!YourMultivalueParam.Count = countrows("YourDataset"),
     "All",
     Join(Parameters!YourMultivalueParam.Label,", ")
 )

(split onto multiple lines for readability)

countrows reference: https://technet.microsoft.com/en-us/library/dd255215.aspx


Credit to other answers, just want to extend them for this common scenario.

like image 22
Tim Abell Avatar answered Sep 18 '22 22:09

Tim Abell