简体   繁体   English

SSRS报告每个参数值的重复表

[英]SSRS report repeat table for every parameter value

Guys sorry for the general question here but I have been looking on the internet and cant find a solution. 伙计们对这里的一般问题感到抱歉,但我一直在互联网上寻找解决方案。

I have an SSRS report. 我有一份SSRS报告。 There is one Parameter user must put in before running, @Location. 在运行@Location之前,必须有一个Parameter用户输入。

In the query its specified to only return results where that location is matched. 在查询中,其指定仅返回匹配该位置的结果。 IE where Company.location = @location IE where Company.location = @location

The results are displayed in a table. 结果显示在表格中。 This all works fine, but I want to change the parameter to contain multiple values.....and then repeat the table for every location the user chooses. 这一切都很好,但我想更改参数以包含多个值.....然后为用户选择的每个位置重复该表。

Any help would be appreciated. 任何帮助,将不胜感激。

Step 1: Create a dataset for your multi-valued parameter, something like this: 第1步:为多值参数创建数据集,如下所示:

SELECT LocationId, LocationName FROM MyLocations

Step 2: Create the parameter @LocationId , with available values from the above dataset, and set it to allow multiple values. 步骤2:使用上述数据集中的可用值创建参数@LocationId ,并将其设置为允许多个值。

Step 3: Create another dataset along these lines for the actual table: 第3步:为这些实际表格创建另一个数据集:

SELECT *
FROM MyDataTable tbl
WHERE tbl.Location IN (@LocationId)

Step 4: Create a List, bind it to the second dataset (select the list, find the "DataSet" property). 步骤4:创建一个List,将其绑定到第二个数据集(选择列表,找到“DataSet”属性)。

Step 5: Open the properties for the Details of the list, group on LocationId . 步骤5:打开LocationId上列表,详细信息的属性。

Step 6: Drop a tablix inside the list, and pick your fields from Dataset2 for that tablix at your leisure. 第6步:在列表中删除一个tablix,然后在闲暇时从Dataset2中为该Tablix选择字段。

Step 7: ... 第7步:......

Step 8: Profit! 第8步:获利!


PS. PS。 There are several alternatives available to do this, including: 有几种方法可以做到这一点,包括:

  • Use a list for the location in combination with a subreport for the actual table. 使用该位置的列表与实际表的子报表组合使用。
  • Use one big table, with groupings for location. 使用一个大表,分组用于定位。

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

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