Print a headerband conditionally on the fly
Hi,
A TppHeaderBand is always printed before the TppDetailBand has been
generated which results in a header only report output when no TppDetailBand
is printed (visible = false for each record). Is there no other way to
abandon printing (quit printing and generate no output what so ever for any
device) in such a case then 2 pass or calculate 'Something_to_print' before
printing. What i would like to do is to print a TppHeaderBand 'only when
needed' in TppDetailBand.BeforePrint when TppDetailBand.Visible is true.
Greetings,
Filip Moons
A TppHeaderBand is always printed before the TppDetailBand has been
generated which results in a header only report output when no TppDetailBand
is printed (visible = false for each record). Is there no other way to
abandon printing (quit printing and generate no output what so ever for any
device) in such a case then 2 pass or calculate 'Something_to_print' before
printing. What i would like to do is to print a TppHeaderBand 'only when
needed' in TppDetailBand.BeforePrint when TppDetailBand.Visible is true.
Greetings,
Filip Moons
This discussion has been closed.
Comments
A few options...
1. Check your dataset before the report is printed and toggle the
visibility of the headerband accordingly.
2. Try setting the NoDataBehaviors property of the report to ndBlankPage :=
True. If this is true and there is no data in the dataset available, the
report will not be displayed.
3. During the first pass of the report, try toggling the visibility of the
header band based on whether the detail band is visible/present or not.
Note: I have not tried this so there may be some issues with timing and
selecting the proper events to use. I would suggest trying the
Detail.BeforePrint event as you mentioned below.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com