I use DBCalc in Footer band with sum option. In old versions of RB (3.5) DBCalc value was reset on next page. Now (I use 6.02) DBClac values accumulate with self values from Prev Pages. How to calculate sum(Field) on page?
Now you can change the timing of a DBCalc in ReportBuilder. Simply right click the DBCalc component and select Timing from the pop-up menu. From the timing dialog you can select when you would like the DBCalc to reset itself.
I'm sorry, I was mistaken. DBCalcs can only be reset on group breaks now using the ResetGroup property. If you would like to reset on each page you will have to do the calculations manually in a TppVariable's OnCalc event and adjust the Timing of that variable.
I'm build work this code (my mistake was PassSetting = psTwoPass) in Footer i'm place Variable1 component and in global vars declare var Sum : currency;
rap code: procedure ReportOnStartPage; begin Sum := 0; end; ------------------------- procedure DetailBeforePrint; begin Sum := Sum+ Query1DataPipeLine['F1']; end; ------------------------- procedure Variable1OnCalc(var Value: Variant); begin Value := Sum; end;
Comments
Now you can change the timing of a DBCalc in ReportBuilder. Simply right
click the DBCalc component and select Timing from the pop-up menu. From the
timing dialog you can select when you would like the DBCalc to reset itself.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
the
itself.
Sorry, but my DBCalc component does not have "Timing" in popup menu!
"Timing" menu have "Variable" component!
Thanks,
Nikolai Bochkarev
I'm sorry, I was mistaken. DBCalcs can only be reset on group breaks now
using the ResetGroup property. If you would like to reset on each page you
will have to do the calculations manually in a TppVariable's OnCalc event
and adjust the Timing of that variable.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
you
Thanks for help of my problem!
Would you help me to write RAP Code to calculate Sum(Field) by page?
I try ti write this code but get failed
Thanks,
Nikolai Bochkarev
(my mistake was PassSetting = psTwoPass)
in Footer i'm place Variable1 component and in global vars declare
var
Sum : currency;
rap code:
procedure ReportOnStartPage;
begin
Sum := 0;
end;
-------------------------
procedure DetailBeforePrint;
begin
Sum := Sum+ Query1DataPipeLine['F1'];
end;
-------------------------
procedure Variable1OnCalc(var Value: Variant);
begin
Value := Sum;
end;
Thanks!
May be this fact add in FAQ? :-)
Nikolai