Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Print a headerband conditionally on the fly

edited March 2006 in General
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

Comments

  • edited March 2006
    Hi Filip,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.