简体   繁体   English

矩阵报表中的SSRS 2008动态列?

[英]SSRS 2008 Dynamic Columns in a Matrix Report?

I have SQL 2008 (not R2). 我有SQL 2008(不是R2)。 I would like to have a matrix report where user can select one of the SQL resultset columns to be the matrix column group.. 我想要一个矩阵报告,用户可以在其中选择SQL结果集列之一作为矩阵列组。

For example 例如

A   B   Value
a1  b1  10
a2  b2  20
a3  b2  30

So the possible matrices could be (user selects from dropdown with A, B). 因此,可能的矩阵为(用户从下拉菜单中选择A,B)。

By A 由A

       a1  a2  a3
Value  10  20  30

By B 由B

       b1  b2
Value  10  50

This question should solve your problem. 这个问题应该可以解决您的问题。 It is a way to use a parameter to refer to a field in your dataset. 这是一种使用参数来引用数据集中的字段的方法。

i havne't actually done anything like this before, but i have a theory that you can modify the expression on the group to have an iif statement to change which field is grouped on 我以前实际上并没有做过类似的事情,但是我有一个理论,您可以修改组中的表达式以使用iif语句来更改要分组的字段

so, for the column group, change the expression for the gorup to something like =iif(ParameterValue=1,Field1,Field2) 因此,对于列组,将gorup的表达式更改为= iif(ParameterValue = 1,Field1,Field2)

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

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