Select SQL Column to filter on with DropDownList in SSRS Report
Posted on 2012-09-18
I'm trying to allow users of an SSRS report to select the column they want to filter by with a DropDownList. In this case WHERE the selected Column contains 'No'.
I have an SSRS Report with a single table. DataSet1 is just a Select statement for all columns.
I put another DataSet called Column_Names that is just a list of column names from INFORMATION_SCHEMA.Columns.
"WHERE @Column_Name IN ('No')" to the Select query of DataSet1 so now I have a DropDownList where I can select from all the columns, but the report comes up with no records.
No errors. I get the report. Just no records are returned even though I know that the column I selected has some 'No' entries. It seems like it should work. If I replace the parameter with an actual column name I do get the records.