Calculating totals
Posted: Wed Apr 10, 2013 9:42 am
Hello
Some time ago I wrote about a problem with calculating totals on a data band - the use of SumIf() function increased the height of the text component that contained the expression. See: http://forum.stimulsoft.com/viewtopic.php?f=12&t=35907. In one of the posts I was advised to use Totals.Sum(). That solves the problem with growing text components.
Now I have a new problem. I have a data band and I calculate the sum of values in one column. I do this using both Sum() and Totals.Sum() and I get two different results. Totals.Sum() does not compute the sum correctly.
I attach a sample project that reproduces the issue. I am using version 2013.1.
I have two questions:
1) why is the result of the calculation incorrect?
2) what is really the difference between Sum() and Totals.Sum()?
All your help will be greatly appreciated.
Some time ago I wrote about a problem with calculating totals on a data band - the use of SumIf() function increased the height of the text component that contained the expression. See: http://forum.stimulsoft.com/viewtopic.php?f=12&t=35907. In one of the posts I was advised to use Totals.Sum(). That solves the problem with growing text components.
Now I have a new problem. I have a data band and I calculate the sum of values in one column. I do this using both Sum() and Totals.Sum() and I get two different results. Totals.Sum() does not compute the sum correctly.
I attach a sample project that reproduces the issue. I am using version 2013.1.
I have two questions:
1) why is the result of the calculation incorrect?
2) what is really the difference between Sum() and Totals.Sum()?
All your help will be greatly appreciated.