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?
The easy way will be to count the number of the selected parameters and compare them to the dataset
In case anyone is still having issues doing this, I just coded this easy fix.
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:
(split onto multiple lines for readability)
countrows
reference: https://technet.microsoft.com/en-us/library/dd255215.aspxCredit to other answers, just want to extend them for this common scenario.
The problem is if you're trying to pull something for another data set then cross referencing the row count in another dataset won't work. You will have to go with what the previous post states. Create an internal parameter of the exact type and assign the default value to the entire dataset. That way you have the max count of the rows since the hidden
parameter.count = rowscount
. That way you can use it within another dataset also provided that dataset is AFTER the first one is populated.According to microsoft's ssrs help search:
=Parameters! .Count Returns the integer value 1. For a single-value parameter, the count is always 1.
I verified this does indeed work, check the integer returned for the built-in parameter count field.
Allow multiple values on a parameter selection. Checking the value of the above field will let you know how many values the user actually chose.
In my situation, I allow multiple values on company number. This gives users the ability to choose one company to report on or several at once. Per client request, if they choose more than one, display data horizontally. If only one company is chosen in the parameter list, show the data vertically and hide the other tablix.
So my visibility show or hide expression looks like this in the one tablix:
=IIF(Parameters!company_number.Count > 1, True, False)
and like this in the other:
=IIF(Parameters!company_number.Count = 1,True,False)
Happy coding! Robyn
Your approach sounds good: I would make the options for the parameter come from a dataset.
Then you can use
=COUNTROWS("DataSetName")
to return the total number of options for your parameter and compare this with Parameters!Parameter.Count as you suggest.