question

yogi avatar image
yogi asked

Dynamic filtering criteria in ssrs

I have report which returns data from a SQL Server 2008. The user would like to be able to dynamically add filtering, e.g. show me only data with Language = English, or show me only data for a given organizational unit or stuff like that. The number of filter criteria is big (almost 50). But how do I do that?? I have my report, with the basic query (SELECT (fields) FROM MyView WHERE ......) inside the report data set - how can I dynamically add filtering to that??
ssrsssrs-2008
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
aRookieBIdev avatar image
aRookieBIdev answered
You should have a report parameter which should be passed on to the sql query or the stored procedure in the dataset. You can create a report parameter with set of pre defined values or values from db. This report parameter could be a check box or drop down box or text box.You could also set default values and data types of the report parameter. The report parameter should then be mapped to the parameter in your stored procedure or your query. Your query should be select value from table where column = @filerparameter In case you have multiple select in the report parameter then select value from table where column in (@filerparameters)
6 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

thanks for the response but what i want is to pass both the column and the @filterparameter so after where there will be nothing in my query it has to be passed dynamically
0 Likes 0 ·
you can build the query dynamically using expressions.
0 Likes 0 ·
can you please explain how i can work it out with reports
0 Likes 0 ·
http://www.sqlservercentral.com/Forums/Topic98259-150-1.aspx#bm98544 This article should be useful. You can either have a dynamic query in expressions or use a stored proc with input parameters which builds the dynamic query.
0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.