【问题标题】:Add Totals Column at the end of table with dynamic number of columns在具有动态列数的表末尾添加总计列
【发布时间】:2012-03-09 03:15:39
【问题描述】:

我正在使用 Reporting Services 2008。我有如下 RDL ![我要求它打印 12 个月,所以我得到以下内容]

1 月 2 月 3 月 4 月 5 月 6 月 7 月 8 月 9 月 10 月 11 月 12 月 总计
1---1----1---1-----1----1---1---1---1----1---1---1 ----12

现在,当我要求它打印 4 个月时,我得到以下内容![4 个月]
1 月 2 月 3 月 4 月 总计
1---1----1---1-----12

我希望最后的 Totals 列仅汇总打印的月份。目前它正在总结所有月份,因为我将以下代码放在 Totals Expression 后面。

=Sum(Fields!retail1.Value + Fields!retail2.Value + Fields!retail3.Value + Fields!retail4.Value + Fields!retail5.Value + Fields!retail6.Value + Fields!retail7.Value + Fields!retail8.Value + Fields!retail9.Value + Fields!retail10.Value + Fields!retail11.Value + Fields!retail12.Value)

每列隐藏或显示的表达式如下:

=iif(Parameters!StartMonth.Value <= 5 and Parameters!EndMonth.Value >= 5,False,true)

如何仅显示所选月份的总数。从 RDL 本身,无需更改查询。

提前致谢。

【问题讨论】:

    标签: dynamic service reporting rdl


    【解决方案1】:

    你的整体表达应该是这样的:

    =Sum(IIF(Parameters!StartMonth <= 1 And Parameters!EndMonth >= 1, Fields!retail1.Value, 0)) 
    + Sum(IIF(Parameters!StartMonth <= 2 And Parameters!EndMonth >= 2, Fields!retail2.Value, 0))
    + Sum(IIF(Parameters!StartMonth <= 3 And Parameters!EndMonth >= 3, Fields!retail3.Value, 0)) 
    + ... and so on
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-25
      • 2020-10-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-06
      相关资源
      最近更新 更多