Globals not being set
Hi,
RB 10.09. D7.
I have a report in wich I want to make some calcs mannually.
It has to be two passes.
I tried to use the report.firstPass in a if clause in order to accumulate my
calcs only once.
On endFirstPass I did a ShowMessage('EFP').
On detail.beforeGenerate I make my calcs.
The calcs never go right and for some rows it is called more than once. In
the beforeGenerate I have a code like this:
if report.firstPass then
label1.text := resultOfTheCalc;
When I run the report the 'EFP' showmessage shows up and AFTER that my label
is changed.
Well, if the end of first pass was reached and I have a if checking if I´m
in the first pass, why it happens?
Thank you.
RB 10.09. D7.
I have a report in wich I want to make some calcs mannually.
It has to be two passes.
I tried to use the report.firstPass in a if clause in order to accumulate my
calcs only once.
On endFirstPass I did a ShowMessage('EFP').
On detail.beforeGenerate I make my calcs.
The calcs never go right and for some rows it is called more than once. In
the beforeGenerate I have a code like this:
if report.firstPass then
label1.text := resultOfTheCalc;
When I run the report the 'EFP' showmessage shows up and AFTER that my label
is changed.
Well, if the end of first pass was reached and I have a if checking if I´m
in the first pass, why it happens?
Thank you.
This discussion has been closed.
Comments
Calculations should never be made from any event other than the
TppVariable.OnCalc event. All other events could fire more than once
per traversal/page. See the following article on the proper way to make
calculations from within a report.
http://www.digital-metaphors.com/rbWiki/Delphi_Code/Calculations/Overview
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com