Problem with sum function
Problem with sum function
Hi,
I've got a problem with sum function for a field inside a page. In my scenario I set the DataBand property CanBreak to true, in order to eventually split the DataBand in more than a page. But I have a case (see the example) in which the sum is not correct because the second field to sum is inside my first page and its DataBand finishes in the second page, so the field is not considered in the sum calculation of the first page but it is included in the sum calculation of the second page.
There is a way to calculate the sum of two field in a page even if the DataBand of the second record finishes in the second page?
I attach a report with data as an example.
Thank you
Fabio Magnani
I've got a problem with sum function for a field inside a page. In my scenario I set the DataBand property CanBreak to true, in order to eventually split the DataBand in more than a page. But I have a case (see the example) in which the sum is not correct because the second field to sum is inside my first page and its DataBand finishes in the second page, so the field is not considered in the sum calculation of the first page but it is included in the sum calculation of the second page.
There is a way to calculate the sum of two field in a page even if the DataBand of the second record finishes in the second page?
I attach a report with data as an example.
Thank you
Fabio Magnani
- Attachments
-
- Report.xml
- Data
- (419 Bytes) Downloaded 160 times
-
- Report.mrt
- Report
- (9.21 KiB) Downloaded 150 times
Re: Problem with sum function
Hello.
You Sum column on the DataBand1. The sum is calculated on that page, where the band is finished its rendering.
As a way you could calculate sum manually in a variable. Don't forget to set the Process At property of the text component on the page footer to EndOfPage. Than you.
You Sum column on the DataBand1. The sum is calculated on that page, where the band is finished its rendering.
As a way you could calculate sum manually in a variable. Don't forget to set the Process At property of the text component on the page footer to EndOfPage. Than you.
Re: Problem with sum function
Hello,
thanks for the reply.
Your solution solves the case I described in the previous request, but if you move the "Test.Price" field near to End DataBand text, and doing that, the field moves to the second page, then your solution still sum the two values. In fact, the second field is visible into the second page, but its value is still calculated on the first page.
I attach a report with data as an example.
Fabio Magnani
thanks for the reply.
Your solution solves the case I described in the previous request, but if you move the "Test.Price" field near to End DataBand text, and doing that, the field moves to the second page, then your solution still sum the two values. In fact, the second field is visible into the second page, but its value is still calculated on the first page.
I attach a report with data as an example.
Fabio Magnani
- Attachments
-
- Report.mrt
- Report
- (10.76 KiB) Downloaded 150 times
Re: Problem with sum function
Hello.
Sorry it was my fault. Please use After Print event of the Data Band instead of the Text component. Thank you.
Sorry it was my fault. Please use After Print event of the Data Band instead of the Text component. Thank you.
Re: Problem with sum function
Hello,
thanks for the reply.
Your last solution solves the case I described in the second post but still does not solve the first post.
Fabio Magnani
thanks for the reply.
Your last solution solves the case I described in the second post but still does not solve the first post.
Fabio Magnani
Re: Problem with sum function
Hello.
We need some additional time to prepare answer for you.
Thank you.
We need some additional time to prepare answer for you.
Thank you.
Re: Problem with sum function
Hello,
thanks for the reply.
I will be waiting for your reply.
Fabio Magnani
thanks for the reply.
I will be waiting for your reply.
Fabio Magnani
Re: Problem with sum function
Hello.
Usually the band has single line of text component and this problem does not occurs.
We have created your another solution.
You should use code from the End Render event of the report from the attached report template.
Set also Tag property of the text component that you summing.
Thank you.
Usually the band has single line of text component and this problem does not occurs.
We have created your another solution.
You should use code from the End Render event of the report from the attached report template.
Set also Tag property of the text component that you summing.
Thank you.
- Attachments
-
- Report.mrt
- (10.28 KiB) Downloaded 251 times