Click here to Skip to main content
15,884,083 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
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.
Posted
Updated 27-Feb-12 11:11am
v2
Comments
Shahin Khorshidnia 27-Feb-12 14:53pm    
Not clear. Improve your question please.
Sergey Alexandrovich Kryukov 27-Feb-12 17:17pm    
Not a question. What's the problem?
--SA
zigzagooo 27-Feb-12 17:19pm    
in the matrix there is no total i wanna it be done that's all

1 solution

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:

C#
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();
}



You can also add all CellValues on passing them to TextBoxes, then you don't need TryParse(... and foreach(

I hope it will help.
 
Share this answer
 
v2
Comments
zigzagooo 27-Feb-12 18:15pm    
and if it just static values on the report No dataset??? i wanna just sum the static values inside the matrix cells in a cell called total. using expressions

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900