When to use Totals.Count() vs Count()

Stimulsoft Reports.WEB discussion
Post Reply
jay@bplogix.com
Posts: 251
Joined: Fri Feb 04, 2011 11:46 am
Location: San Diego, CA

When to use Totals.Count() vs Count()

Post by jay@bplogix.com »

In the expression builder, under totals it uses the function {Count} ... but when I use this in a header or footer of a DataBand it does not work (the report errors when run). Searching through the forums, I see you tell people to use Totals.Count instead of Count. What is the difference? When should a user use Count and when should they use Totals.Count?

Thanks!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

When to use Totals.Count() vs Count()

Post by Alex K. »

Hello,

Usually, components in what text expressions the aggregate function call is specified, must be put on the total band or on the Data band. If it is required to output the total on the Header band then it is either impossible or possible using the script. But in Stimulsoft Reports the component with the aggregate function can be placed in any kind of a band.
Also you can put an aggregate function on a page and other pages. For example, you can calculate the sum of values in the list and show it in the header of the list. Also you may calculate the number of strings and show its value in the beginning of a page.

Thank you.
jay@bplogix.com
Posts: 251
Joined: Fri Feb 04, 2011 11:46 am
Location: San Diego, CA

When to use Totals.Count() vs Count()

Post by jay@bplogix.com »

When do I use Count and when do I use Totals.Count?
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

When to use Totals.Count() vs Count()

Post by Ivan »

Hello,

Simple explanation: please use the Totals.Count method if does not work the Count method.

Thank you.
Post Reply