【问题标题】:Reporting Services: how to apply interactive sort for matrix columns?Reporting Services:如何对矩阵列应用交互式排序?
【发布时间】:2011-08-30 15:53:26
【问题描述】:

我需要对包含聚合数据的矩阵列应用交互式排序。

报告正在统计在不同地方销售的产品:

                 Product A          Product B         Product C
---------------------------------------------------------------
Country 1                5                 10                 4
  City A                 3                  0                 3
  City B                 2                 10                 1
---------------------------------------------------------------      
Country 2               10                  5                 5
  City C                 2                  4                 2
  City D                 8                  1                 3

在对“产品 A”进行降序排序后,表格行应按国家/地区的“产品 A”销售额和城市销售额排序:

                 Product A          Product B         Product C
---------------------------------------------------------------      
Country 2               10                  5                 5
  City D                 8                  1                 3
  City C                 2                  4                 2
---------------------------------------------------------------
Country 1                5                 10                 4
  City A                 3                  0                 3
  City B                 2                 10                 1

矩阵方案如下所示:

                   | [Product]
[Country] | [City] | [Count(Product)]

【问题讨论】:

    标签: sorting reporting-services


    【解决方案1】:

    矩阵不支持交互式排序。

    解决方法可能如下:

    使用值创建按参数排序:

    Label                   Value
    Country ASC, City ASC     1
    Country DESC, City ASC    2
    Country ASC, City DESC    3
    Country DESC, City DESC   4
    

    然后在国内创建两个排序表达式:

        =Iif(Parameters!SortBy.Value = 1 OR Parameters!SortBy.Value = 3,Fields!country.Value,"")
    ASCENDING sort
        =Iif(Parameters!SortBy.Value = 2 OR Parameters!SortBy.Value = 4,Fields!country.Value,"") 
    DESCENDING sort
    

    对城市做同样的事情:

        =Iif(Parameters!SortBy.Value = 1 OR Parameters!SortBy.Value = 2,Fields!city.Value,"")
    ASCENDING sort
        =Iif(Parameters!SortBy.Value = 3 OR Parameters!SortBy.Value = 4,Fields!city.Value,"")
        DESCENDING sort
    

    【讨论】:

    • 用户如何在“SortBy”值之间切换?
    • 通过选择可用的参数值之一
    猜你喜欢
    • 2011-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-24
    • 1970-01-01
    • 2014-01-04
    • 2019-01-30
    相关资源
    最近更新 更多