In SQL Reporting Services, how to filter a dataset according to a parameter?

℡╲_俬逩灬. 提交于 2019-12-05 05:50:01
Vinzz

I answer to my own question, the filter expression is in fact:

=Fields!Name.Value Like ="*"+ Parameters!FilterName.Value + "*"

i.e. use "*" instead of "%", in fact.

The preferred practice is to go with an exact match.

You can build a multi value parameter list from the data set returned from you query or an alternative query, thereby ensuring an exact match can be achieved.

The following reference may prove useful.

http://msdn.microsoft.com/en-us/library/ms155917.aspx

I would suggest you apply the filter as part of the SQL statement that is executed to bring back the DataSet instead of trying to apply filters in the Reporting Services report. I think the SQL Engine is much more optimized to handle these types of filters/queries.

Your answer got me on the right track :) ! Maybe it is different for SQL Server 2005; But the following solution worked for me:

=Fields!AppName.Value    Like    ="*" & Parameters!FilterApplication.Value & "*"

Go to the properties for the data set, go to the filter tab. in the expression dropdown list click the field you want to filter by (Name). click the operator and select like. in the value box click the expression selection. a new window will open. go down to your parameters list and add the parameter to the equation. click ok.

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