分别汇总报告项目的分组总计

时间:2019-04-08 03:34:22

标签: reporting-services aggregate ssrs-2012 ssrs-grouping

enter image description here我有一个报告项目,该报告项目基于2个不同实体的计算结果。 我正在尝试根据产品编号对报告进行分组。但是我无法获得每个组的总数。但是找到了一种使用以下代码从报告中获取总计的方法。 我想找到一种汇总每种产品总数并将其移至下一个产品时将其设置为零的方法。

已经尝试过:为数据集创建一个单独的计算字段,但是由于它是来自2个不同的数据集,因此我无法创建计算字段。 尝试引用报告中其他地方的汇总并尝试引用它,但这没有用。

Public totalReplacement as Integer
Public totalGSF as Integer

Public Function AddTotalReplacement(ByVal replacement AS Integer )
totalReplacement = totalReplacement + replacement
End Function

Public Function AddTotalGSF(ByVal thisGSF AS integer)
totalGSF = totalGSF + thisGSF
End Function

Public Function GetTotalReplacement()
return totalReplacement
End Function

Public Function GetTotalGSF()
return totalGSF
End Function

上面的代码将每个产品的总数与之前的总数相加。但是我希望在移至下一个产品时使总替换量为零。

1 个答案:

答案 0 :(得分:0)

好吧,做下面的事情

  1. 切换到“设计”视图。
  2. 右键单击包含该字段的数据区域单元格 [已创建到字段数量(AA)],然后单击添加总计。
  3. 这将添加一行,其中包含每个订单的美元金额。

尝试此操作,结果为11。让我知道这是否适合您。

相关问题