报告查看器总和文本框 [英] report viewer sum textbox
问题描述
大家好
我有一个带有一些值的Tablix,如下所示:
3个月6个月9个月12个月**总计**
利润100 50 75 20 ** 245 **
我想将矩阵单元格值设为100、50、75、20,总计245个单元格,所以没有列组和一个行组Profit.
hi guys
i am having a tablix with some values as follows:
3 monthes 6 monthes 9 monthes 12monthes **Total**
profit 100 50 75 20 **245**
i wanna the matrix cell values : 100,50,75,20 summed in total 245 cell there is no column group and one row group Profit.
推荐答案
Hello
我强调这个问题仍然不清楚,但是:
1.如果数据是从数据库绑定的:
我更喜欢在数据库表中有一个计算列规范.
2.如果您有用于更新单元格的方法或事件或...,请在此块中计算总和(单元格更新后)
例如:
Hello
I emphasize that the question is still unclear, but:
1. If data is bound from a database:
I prefer to have a Computed Column Specification in my Database Table.
2. If you have a method or event or ... for Update cells, compute sum in this block (After cells updated)
for example:
public void UpdateCells()
{
// My Previous code right here...
int sum = 0, myValue = 0;
foreach (TextBox t in myCellCollection)
{
if (int.TryParse(t.Text, out myValue))
sum += myValue;
}
SumText.Text = myValue.ToString();
}
您还可以在将所有CellValue传递给TextBox
es时添加它们,然后就不需要TryParse(...
和foreach(
希望对您有所帮助.
You can also add all CellValues on passing them to TextBox
es, then you don''t need TryParse(...
and foreach(
I hope it will help.
这篇关于报告查看器总和文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!