Sorry if this is a simple question, maybe I missing something, but how do I create a running total? I want to calculate a balance coloumn like:
Reason | Credit/Debit | Balance
---------+--------------+----------
XXX | 10.0 | 10.0
XXX | 10.0 | 20.0
XXX | 10.0 | 30.0
I see there is a section in the manual entitled "Calculation of a growing total" [1], but this doesn't make a huge amount of sense to me. Is this possible easily though the desiner GUI or do I have to write some C# code to achive this?
[1] http://www.stimulsoft.com/Documentation ... tarted.htm
Running Totals
Running Totals
There exists two ways to calculate sums based on condition in the StiText component.
1. It is possible to calculate sums via SumIf function:
{SumIf(MyDataSource.MyDataColumn,Condition)}
2. Also this goal may be achieved via Totals.
Sum by all data without taking into condition may be counted very simply.
For example you have DataBand1 with Data on it. In that case a result of calculating the balance my be achieved in the following way:
This code you should also assign to the Text property of some StiText component.
Please note, that this component with sum calculated may be placed in any part of the report's page as in the Footer as well to the Header band.
Please see an example based on your data.
http://forum.stimulsoft.com/upload/Tota ... xample.zip
Thank you.
1. It is possible to calculate sums via SumIf function:
{SumIf(MyDataSource.MyDataColumn,Condition)}
2. Also this goal may be achieved via Totals.
Code: Select all
{IIF(Condition,Totals.Sum(MyDataSource,(Condition?MyDataSource.MyDataColumn:0))}
For example you have DataBand1 with Data on it. In that case a result of calculating the balance my be achieved in the following way:
Code: Select all
{Sum(DataBand1,BalanceTable.Debet)-Sum(DataBand1,BalanceTable.Credit)}
Please note, that this component with sum calculated may be placed in any part of the report's page as in the Footer as well to the Header band.
Please see an example based on your data.
http://forum.stimulsoft.com/upload/Tota ... xample.zip
Thank you.
Running Totals
Running totals without writing any code (as build-in function) is already in our to-do list.
When the function will be available, we will post a message in this topic.
Thank you.
When the function will be available, we will post a message in this topic.
Thank you.