Subreport Variable question
One some of my reports I need to use display variables to output a yes/no
value based on a database value, then count up the number of yes' for a
tally. Currently, the way the reports are written, I am using sub reports
that contain these display variables and the yes/no displays are in the
details while the tally is in the summary. I need to have the tally reset
each time the sub report is run, and tried doing so in a number of places,
but each time, it just shows the total tally for all sub reports. Where can
i insert my code to set the tally equal to 0? Thanks.
Tom
value based on a database value, then count up the number of yes' for a
tally. Currently, the way the reports are written, I am using sub reports
that contain these display variables and the yes/no displays are in the
details while the tally is in the summary. I need to have the tally reset
each time the sub report is run, and tried doing so in a number of places,
but each time, it just shows the total tally for all sub reports. Where can
i insert my code to set the tally equal to 0? Thanks.
Tom
This discussion has been closed.
Comments
I'm a bit unclear about your specifications. From your description below it
seems you only want to display the tally of the last subreport printed. If
this is the case, why bother keep the tally for the previous subreports?
The TppVariable component has a reset property in which you can define when
the value will be reset. One option would be to create a group around the
subreport and have the variable reset when that group breaks.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
use the OnReset property, would that be something like this?
if pipeline1['CODE'] <> pipeline2['CODE'] then value := 0;
or am I thinking completely wrong?
Thanks.
Tom
The OnReset fires when the variable automatically resets its value according
to the reset settings. (right click over the TppVariable component and
select "timing").
In your case, I believe your best option would be to keep a separate
variable for each subreport. This way there is no need to reset a single
variable value. Note that it is not necessary to actually show each
individual variable, you can simply use their OnCalc events to calculate the
value you need elsewhere in the report.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Tom