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

Hiding bands dynamically

edited June 2004 in General
Hello,

I want to be able to suppress a detail band based on the data driving the
band. I tried putting ppDetailBand1.Visible := False in the BeforePrint and
BeforeGenerate events, then setting Visible back to True in the AfterPrint
and/or BeforeGenerate for the next iteration, but it seems to stop
generating the band from that point forward.

What's the best way to hide a detail band without affecting the remaining
bands?

Thanks,

Mike Van Nuland

Comments

  • edited June 2004
    Hi Mike,

    Instead of waiting for the AfterPrint event to set the detail band's
    visibility back to True, just toggle the visibility inside the BeforePrint.
    Something like...

    if Report.DataPipeline['Worthless'] then
    ppDetailBand1.Visible := False
    else
    ppDetailBand1.Visible := True;


    --
    Best Regards,

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