How to filter one dataset value with another dataset Table value in SSRS

后端 未结 2 605
迷失自我
迷失自我 2021-02-20 00:33

How to filter one dataset table with another dataset Table value in SSRS.

相关标签:
2条回答
  • 2021-02-20 00:38

    Not sure if there is a better way to do this in SSRS 2005, but this should work:

    1. Create dataset A. This will be your filter dataset. You should return only one value column. (If you need multiple values, you'll have to join them)
    2. Create a new report parameter called ParameterA. Set both the available values and the default values to the value column result from the dataset A. Set the parameter to Hidden (I think Internal might be a better choice..try it out)
    3. Create a second dataset B. Add ParameterA as a parameter to dataset B, called @parameterA.
    4. In your query, use the parameter like this:

    SELECT blah blah WHERE valueColumn IN (@parameterA)

    This should do what you're looking for. It's not pretty, but it should work.

    0 讨论(0)
  • 2021-02-20 01:02

    To filter second dataset, like Master/Details you need to use subreport, place second dataset in subreport and filter it by subreport parameter. Subreport, when placed on the report can have parameter value from the field of the first dataset.

    0 讨论(0)
提交回复
热议问题