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

送分小仙女□ 提交于 2019-12-21 07:25:19

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/856913/how-to-filter-one-dataset-value-with-another-dataset-table-value-in-ssrs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!