简体   繁体   中英

SSRS Parameter to select a column name on value which to filter the dataset

I need to allow my user to select a column name and its value from a parameter (or two params) to filter the result.

I have a text parameter with a few column names that are listed in my dataset Column1, Column2, Column3. Each of those columns has only two values 1 and 0.

I would love some help in getting an idea how to filter my dataset based on the column name listed in the parameter and a selected value (1 or 0)

I assume it has to be related to a dynamic sql but, not sure how to incorporate that in either the WHERE clause or the actual dataset filter.

Thanks for any points guys!! :)

In the tablix you can use the filter section to set the criteria col1 = param1.This will only select the rows that match the value of the parameter.

https://www.mssqltips.com/sqlservertip/2597/dataset-and-tablix-filtering-in-sql-server-reporting-services/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM