简体   繁体   English

SSRS 2008中的Tablix

[英]Tablix in SSRS 2008

I use a tablix in SSRS 2008 with a Region name and it may contain 10 different regions. 我在SSRS 2008中使用带有区域名称的Tablix,它可能包含10个不同的区域。 Currently, the regions are sorted in the code alphabetically but I have to sort them differently, so I assigned a number to each in the CASE statment based on the desired order. 目前,区域按字母顺序排列在代码中,但我必须对它们进行不同的排序,因此我根据所需的顺序为CASE语句中的每个分配了一个数字。 I then sorted the regions by the required order in the tablix itself and the regions are sorted in the desired order in the report but unfortunately, the number assigned is in the report instead of the region name. 然后,我按Tablix本身中所需的顺序对区域进行了排序,并且区域按照报告中的所需顺序排序,但不幸的是,分配的数字在报告中而不是区域名称中。 Instead of getting 而不是得到

BF CF CO CL etc…. BF CF CO CL等...... I get 我明白了

1 2 3 4 etc in the heading of the report. 报告标题中的1 2 3 4等。

any help will be greatly appreciated. 任何帮助将不胜感激。

CASE , 
WHEN teamgroup.Name = 'BF' THEN 1
WHEN teamgroup.Name = 'CF' THEN 2
WHEN teamgroup.Name = 'CO' THEN 3
WHEN teamgroup.Name = 'CL' THEN 4
WHEN teamgroup.Name = 'CN' THEN 5
WHEN teamgroup.Name = 'GA' THEN 6
WHEN teamgroup.Name = 'IN' THEN 7
WHEN teamgroup.Name = 'KY' THEN 8
WHEN teamgroup.Name = 'MD' THEN 9
WHEN teamgroup.Name = 'NF' THEN 10
END AS Region

You still need to have teamgroup.Name as a column in your resultset, in addition to your sort column. 除了排序列之外,您还需要将teamgroup.Name作为结果集中的列。 Do this instead: 改为:

teamgroup.Name AS Region,
CASE
...
END AS Region_Sort

And then in your SSRS, add the Region column to your Tablix. 然后在您的SSRS中,将Region列添加到Tablix。 In the sorting properties for the table, use Region_Sort . 在表的排序属性中,使用Region_Sort Make sure not to add Region_Sort to your Tablix. 确保不要将Region_Sort添加到Tablix。

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

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