Making Variable Invisible OnPrint
Thanks for the great help recently. Everything going well until this...
Can not seem to make a variable invisible using the onprint to check for
values. This seems to work fine in other contexts, but not here.
In this case to get the values I need to show in the group Header, I
have used LookAhead for the variables.
Variables are in a group header band. Timing is OnTraversal, with reset
on end of this same group. In the case of a DBText, I can set the text
to "blank when 0". But in the case of a date variable, I do not have
that option, so have tried to set it to invisible in the OnPrint for the
variable. I can set it to invisible or visible there alright, but not
depending on the value. Have tried setting the value to 0, null, nil, or
some odd value - testing for that and conditionally setting invisible.
I thought I needed to understand how to read the date variable for "0"
or nil, but the same issue appears to be an issue with a simple integer
value here also.
Thanks for any clue!
Scott
Can not seem to make a variable invisible using the onprint to check for
values. This seems to work fine in other contexts, but not here.
In this case to get the values I need to show in the group Header, I
have used LookAhead for the variables.
Variables are in a group header band. Timing is OnTraversal, with reset
on end of this same group. In the case of a DBText, I can set the text
to "blank when 0". But in the case of a date variable, I do not have
that option, so have tried to set it to invisible in the OnPrint for the
variable. I can set it to invisible or visible there alright, but not
depending on the value. Have tried setting the value to 0, null, nil, or
some odd value - testing for that and conditionally setting invisible.
I thought I needed to understand how to read the date variable for "0"
or nil, but the same issue appears to be an issue with a simple integer
value here also.
Thanks for any clue!
Scott
This discussion has been closed.
Comments
This is likely a timing issue. The final value of a lookahead variable
will not be available until the first pass of the report has finished.
Take a look at the following example on how to retrieve a lookahead
value and use it for other calculations. I would suggest getting the
value in the Band.BeforePrint event and conditionally setting the
visible property of the variable from there.
http://www.digital-metaphors.com/rbwiki/Delphi_Code/Calculations/How_To...Use_a_Look_Ahead_Value_in_a_Calculation
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com