RDLC矩阵中的水平和垂直总计 [英] Horizontally and vertically Totals in RDLC Matrix
问题描述
我在带有SQL Server 2014的VS 2015中使用 RDLC报表
。我有一个 Matrix
报告,其中我需要水平和垂直总计。数据集具有列 Item,Month和Amount
的列。我需要以下报告格式。
在您的情况下请注意,它是
[Sum(Amount)]
而不是[Sum(Value)]
在
我的情况下。
用于显示总计只需将行和列分别添加到组 item
和 Month
之外。
选择 [项目]
行(第二行),然后单击鼠标右键,转到插入行
并选择外部组-低于
。
要添加列,请选择 [月]
列(第二列),右键单击它,然后选择插入列
,然后选择外部组-右
。
现在将这些表达式添加到突出显示的单元格中红色,检查第一张图像。
1: = Sum(Fields!Amount.Value, Month)
2: = Sum(Fields!Amount.Value, item)
它将产生以下矩阵:
让我知道我的答案是否对您有帮助。
I am using RDLC Reports in VS 2015 with SQL Server 2014
. I have a Matrix
Report in which i need totals both horizontally and vertically. DataSet have Columns Item,Month and Amount
. I need below report format.
I have used Add Total Row/Column
but it gives me wrong results. What should be issue.? Any Help..
You can achieve the required totals using scoped SUM
expressions. Supposing you have created the needed rows and columns groups, use a matrix with the following data arrangement.
Note in your case it is
[Sum(Amount)]
instead of[Sum(Value)]
in my case.
For showing the totals just add the row and the column outside the groups item
and Month
respectively.
Select the [item]
row (second row) and right click, go to insert row
and select outside group - below
.
To add the column select the [month]
column (second column), right click it and select insert column
then outside group - right
.
Now add these expressions in the highlighted cells in red, check the first image.
1: =Sum(Fields!Amount.Value,"Month")
2: =Sum(Fields!Amount.Value,"item")
It will produce the following matrix:
Let me know if my answer helps you.
这篇关于RDLC矩阵中的水平和垂直总计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!