Problems with calculation of Grant Totals in FR
Hi !
I have some problems with calculation a grand total in my report.
My report consist from two subreports which have own totals.
I want to have grand total by these subreports on the main page.
I declared a new variable with the next code:
SUM([Cost], PersonalDataBand)+SUM([Cost], StructDataBand) and after I assigned this value to some Memo.
But this memo always show me zero.
Can anyone help me with it ?
I use FastReport v2.5 with Delphi 7.
Thanks,
Roman
I have some problems with calculation a grand total in my report.
My report consist from two subreports which have own totals.
I want to have grand total by these subreports on the main page.
I declared a new variable with the next code:
SUM([Cost], PersonalDataBand)+SUM([Cost], StructDataBand) and after I assigned this value to some Memo.
But this memo always show me zero.
Can anyone help me with it ?
I use FastReport v2.5 with Delphi 7.
Thanks,
Roman
Comments
So the best way is to use the same code, but in the 'OnBeforePrint' of the band of memo where is you result.
Be sure that this memo is designed AFTER the calculations it needs, if not use the 'twopass' report option.
There are some reports like this in the demo.
Understand that fr processes a designpage from top down, l to r,
so you cannot modify an object which has already been processed, from code which is processed after, unless you make a report 2 pass, and gather values in firstpass and store in array or a variable and use if finalpass then blocks of code to
to substitute values stored in array to vars used for display.
take a close look at the main demo group totals in header report. you can apply this concept to any combination.
regards