SumRunning problem
SumRunning problem
I use {SumRunning(DataBandName, MyDataSource.AmountColumn)} but I want to reset this sum to zero when group is change and recalculate the sum in new group as this sample
A(Group)
Column1 SumRunning(Column1)
1 1
2 3
3 6
4 10
5 15
B(Group)
Column1 SumRunning(Column1)
8 8
7 15
3 18
4 22
5 27
Please help me.
A(Group)
Column1 SumRunning(Column1)
1 1
2 3
3 6
4 10
5 15
B(Group)
Column1 SumRunning(Column1)
8 8
7 15
3 18
4 22
5 27
Please help me.
SumRunning problem
Hello,
Sum does not work in groups. You need to use the variables. You may read about it in our documentation http://stimulsoft.com/Documentation.aspx .
Thank you.
Sum does not work in groups. You need to use the variables. You may read about it in our documentation http://stimulsoft.com/Documentation.aspx .
Thank you.
SumRunning problem
Helo
Thank you for your reply , can you give me more detail about what kind of variable I should use for this perpose?
Thanks
Thank you for your reply , can you give me more detail about what kind of variable I should use for this perpose?
Thanks
SumRunning problem
Hello,
====================
Using Stimulsoft Reports you may make calculation of aggregate functions in the code of events of a report. This allows calculating aggregate functions with complex logic or condition. Another advantage of Stimulsoft Reports is that, when calculating, you call the value to be calculated from the report code and make changes. If you want to make such a calculation, the variable which stores the value of an aggregate function is required. For this, you should create a new variable in the data dictionary.
Important! Using variables from the code to store the result of an aggregate function calculation is not allowed. It is necessary to use variables created in the dictionary.
Here you specify the type of a variable, for example Decimal, and the initial value is zero. Then in the Render event of the Data band you should set the code for a variable increment. For example, if you want to calculate the sum of variables of the Products.ItemsInStock field then the code will be as follows:
MyTotals += Products.ItemsInStock;
The RenderingEvent event
The Data band in what the RenderingEvent event calculation will be made
The code for calculating the sum
For calling the variable, that contains the value of a total, write in the following in the text expression:
{MyTotal}
If, after you have written the text expression, you run the report rendering. Then, when the report rendering will reach the component which contains the expression with the total variable, then there will be an output of this variable. Therefore, you should specify to the report generator that the component output must be done right after the whole report rendering - when the variable will be calculated completely. For this, you must set the ProcessAtEnd property of the text component to true.
Notice. Expressions of text components which the ProcessAtEnd properties are set to true are always calculated at the end of the report rendering.
As was written before the total will be calculated and shown in the proper part of a report.
====================
Thank you.
====================
Using Stimulsoft Reports you may make calculation of aggregate functions in the code of events of a report. This allows calculating aggregate functions with complex logic or condition. Another advantage of Stimulsoft Reports is that, when calculating, you call the value to be calculated from the report code and make changes. If you want to make such a calculation, the variable which stores the value of an aggregate function is required. For this, you should create a new variable in the data dictionary.
Important! Using variables from the code to store the result of an aggregate function calculation is not allowed. It is necessary to use variables created in the dictionary.
Here you specify the type of a variable, for example Decimal, and the initial value is zero. Then in the Render event of the Data band you should set the code for a variable increment. For example, if you want to calculate the sum of variables of the Products.ItemsInStock field then the code will be as follows:
MyTotals += Products.ItemsInStock;
The RenderingEvent event
The Data band in what the RenderingEvent event calculation will be made
The code for calculating the sum
For calling the variable, that contains the value of a total, write in the following in the text expression:
{MyTotal}
If, after you have written the text expression, you run the report rendering. Then, when the report rendering will reach the component which contains the expression with the total variable, then there will be an output of this variable. Therefore, you should specify to the report generator that the component output must be done right after the whole report rendering - when the variable will be calculated completely. For this, you must set the ProcessAtEnd property of the text component to true.
Notice. Expressions of text components which the ProcessAtEnd properties are set to true are always calculated at the end of the report rendering.
As was written before the total will be calculated and shown in the proper part of a report.
====================
Thank you.
SumRunning problem
Helo,
Thanks a lot for your support , It's very usefull
Regards
Thanks a lot for your support , It's very usefull
Regards
SumRunning problem
Can you give me 1 simple example?Jan wrote:Hello,
====================
Using Stimulsoft Reports you may make calculation of aggregate functions in the code of events of a report. This allows calculating aggregate functions with complex logic or condition. Another advantage of Stimulsoft Reports is that, when calculating, you call the value to be calculated from the report code and make changes. If you want to make such a calculation, the variable which stores the value of an aggregate function is required. For this, you should create a new variable in the data dictionary.
Important! Using variables from the code to store the result of an aggregate function calculation is not allowed. It is necessary to use variables created in the dictionary.
Here you specify the type of a variable, for example Decimal, and the initial value is zero. Then in the Render event of the Data band you should set the code for a variable increment. For example, if you want to calculate the sum of variables of the Products.ItemsInStock field then the code will be as follows:
MyTotals += Products.ItemsInStock;
The RenderingEvent event
The Data band in what the RenderingEvent event calculation will be made
The code for calculating the sum
For calling the variable, that contains the value of a total, write in the following in the text expression:
{MyTotal}
If, after you have written the text expression, you run the report rendering. Then, when the report rendering will reach the component which contains the expression with the total variable, then there will be an output of this variable. Therefore, you should specify to the report generator that the component output must be done right after the whole report rendering - when the variable will be calculated completely. For this, you must set the ProcessAtEnd property of the text component to true.
Notice. Expressions of text components which the ProcessAtEnd properties are set to true are always calculated at the end of the report rendering.
As was written before the total will be calculated and shown in the proper part of a report.
====================
Thank you.
i having problem when access Text SumRunning from code behind C#. Because i want read number to word from Text SumRunning.
Example: Text SumRunning after calculate is 300000000. How to access number 300000000 from code behind C#
Thanks
SumRunning problem
Hi
There is no such a problem to access a value which had been already rendered, as you can use a variable from Dictionary. So value of this variable is unchanged for every rendered databand row.
Please see the report in the attachment.
Thank you.
There is no such a problem to access a value which had been already rendered, as you can use a variable from Dictionary. So value of this variable is unchanged for every rendered databand row.
Please see the report in the attachment.
Thank you.
- Attachments
-
- 200.RunningTotals.mrt
- (14.7 KiB) Downloaded 720 times
SumRunning problem
Thanks Edward, but hoow to access variable MyVariable from Code Behind?
When i access variable MyVariable is emtpy
Code i used:
rpt.Dictionary.Variables["MyVariable"].Value
This is example (attach). How to access value txtTotalPrice after calculate
When i access variable MyVariable is emtpy
Code i used:
rpt.Dictionary.Variables["MyVariable"].Value
This is example (attach). How to access value txtTotalPrice after calculate
- Attachments
-
- 201.Sample.mrt
- (42.1 KiB) Downloaded 692 times
SumRunning problem
i want convert totalprice decimal to word same function ToCurrencyWords in Stimusoft report
but i need convert to Vietnam language.
but i need convert to Vietnam language.
SumRunning problem
Hello,
Thank you.
You can use following code:khongminh9 wrote:Thanks Edward, but hoow to access variable MyVariable from Code Behind?
When i access variable MyVariable is emtpy
Code i used:
rpt.Dictionary.Variables["MyVariable"].Value
This is example (attach). How to access value txtTotalPrice after calculate
Code: Select all
rpt["MyVariable"]