SSRS adding a default blank to parameter properties

帅比萌擦擦* 提交于 2019-12-13 18:05:55

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!