简体   繁体   English

如何从SSRS参数下拉列表中删除多个值

[英]How to remove multiple values from SSRS parameter drop down

I have a report where I want to add a parameter as a drop down. 我有一个报告,我想在其中添加一个参数作为下拉列表。 The database has more than 13,000 records and the parameter I want to add is of the building names in the record. 该数据库有13,000多个记录,我要添加的参数是记录中的建筑物名称。 There are around 6 different building names. 大约有6个不同的建筑物名称。 When I add the parameter by taking Values from a query and passing the building name as the value, the drop down repeats the 6 building names of all 13,000 records rather than just the 6 building names. 当我通过从查询中获取值并将建筑物名称作为值来添加参数时,下拉列表将重复所有13,000条记录的6个建筑物名称,而不仅仅是6个建筑物名称。

Is there a way where I can filter it to show the 6 building names and then show the records related to that building name? 有什么方法可以过滤它以显示6个建筑物名称,然后显示与该建筑物名称相关的记录?

SELECT  new_studentid, new_studentinformationid, new_firstname, new_lastname, new_building, new_busnumber, new_grade, new_primaryhomeroom,documentbody FROM  StudentInformation WHERE(new_building = @new_building) AND (new_primaryhomeroom = @new_primaryhomeroom)

You will need to make a query just for the parameter drop-down. 您只需要针对参数下拉列表进行查询。 It should probably be something like this: 可能应该是这样的:

SELECT  DISTINCT new_building
FROM  StudentInformation 

Then for the HomeRoom parameter, use this query: 然后对于HomeRoom参数,使用以下查询:

SELECT  DISTINCT new_primaryhomeroom
FROM  StudentInformation 
WHERE(new_building= @new_building)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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