问题
One can put the distinct values from a table into a dropdown in SSRS reports using
'parameter' --> "Parameter Properties' --> 'Available Values' --> Get Values From a query.
This works. However, is there a way to add a blank so that one can filter for any / all with a 'like' statement.
I use Visual Studio 2015, but the underlying databse is SSMS 2008 R2 (!)
The SSRS syntax for this filtering is VB:
="*" + Parameters!OurParameter.Value + "*"
It would be nice to let the user see all potential rows, if that is what the user wants.
回答1:
There are a couple ways you can go about letting the user select all the values.
One option is to set "allow multiple values" in the parameter properties. This adds a "Select all" option to the drop down list. In order for this to work, you'll need to update your query to accept multiple values.
For example, instead of
MyCol = :MyParam
You would write
MyCol in (:MyParam)
The other option is to UNION
an "All" option to the query that you are using to populate the available values. In order for this to work you would update the filter in your main query to something like this:
(MyCol = :MyParam OR :MyParam = 'All')
来源:https://stackoverflow.com/questions/51216005/ssrs-adding-a-default-blank-to-parameter-properties