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

Toggling visibility of Group Footer Band based on Group value.

Hi,

I have a Group in my report that is grouping by a field that can have values "Current" and "Future". I want the Group Footer to only be visible when the Group Value is "Current", so it would appear like below:

Current
Data Data Data
Data Data Data
Group Footer ------
Future
Data Data Data
Data Data Data


The problem is that I'm trying to use the OnBeforePrint event for the Group Footer and set its visibility there, but when the visibility is togged off when the value is "Future" it also removes the footer for the "Current" values.

How can I toggle the group footer on and off to get the above desired layout?

Comments

  • edited March 12
    Hi Andrew,

    In my quick testing, toggling the visibility of the group footer band from he BeforePrint event worked as expected.

    In my test I used the RBDemos database and the Orders table separated into group by CustNo. Below is my code that hid the first group footer but displayed the rest.
    procedure TForm2.ppGroupFooterBand1BeforePrint(Sender: TObject);
    begin
    ppGroupFooterBand1.Visible := ppGroup1.CurrentValue <> '1221';

    end;
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • This works for me too. The code I was using was relying on the pipeline I have, which wasn't maintaining the order of groups, so they were mixed together. Thank you for your help and your time!
Sign In or Register to comment.