Page 1 of 1

Calculating totals

Posted: Wed Apr 10, 2013 9:42 am
by kro
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.

Re: Calculating totals

Posted: Thu Apr 11, 2013 2:47 pm
by HighAley
Hello.

Sorry for delay with answer. We need some additional time.

Thank you.

Re: Calculating totals

Posted: Mon Apr 22, 2013 7:53 am
by HighAley
Hello.

We have fixed your issue. The patch will be available in our next prerelease build on April 26.

Thank you.

Re: Calculating totals

Posted: Mon Apr 22, 2013 9:46 am
by kro
Hello.

Thanks for the news.

I am glad the issue is fixed but I would still like to know the answer to my question: what is the difference between Sum() and Totals.Sum()?

Re: Calculating totals

Posted: Mon Apr 22, 2013 11:48 am
by Alex K.
Hello,

The calculation totals in a report can be done by specifying an expression, for example, {Sum (DataBand1)}. These totals are calculated when rendering the report: each time when a single operation with the DataBand is done, a single value is calculated. All calculated values makes a total value, which will be displayed. In Stimulsoft Reports calculation of totals can be produced in another way - instantly. You should use the special Totals prefix. Calculation of totals occurs where the function is called, in contrast to standard results, calculations are performed while report rendering. Consider the calculation of totals in a report by the example of a report with grouping. Suppose there is a report with grouping.
http://admin.stimulsoft.com/Documentati ... sub=Totals

Thank you.

Re: Calculating totals

Posted: Mon Apr 22, 2013 12:00 pm
by kro
Thank you for your reply, now I know everything I wanted to know.

Re: Calculating totals

Posted: Mon Apr 22, 2013 12:50 pm
by Alex K.
Hello,

We are always glad to help you!
Let us know if you need any additional help.

Thank you.