How to filter one dataset value with another datas

2020-07-03 07:11发布

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

2条回答
Emotional °昔
2楼-- · 2020-07-03 07:40

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.

查看更多
Anthone
3楼-- · 2020-07-03 07:41

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.

查看更多
登录 后发表回答