Hiding duplicate subtotals
In my reports, I have a groupheader hierarchy of four layers with corresponding groupfooters. Generally, this works very well for my users. However, some of my users like using those headers as descriptive headers. The problem this creates is it adds duplicate subtotals of the same amount. I need to hide those matching subtotals. I have added coding below of what I have so far. Unfortunately, with my current coding, if the statement is true in one part of the report, the respective groupfooter is removed everywhere in the report. I was hoping someone could help me understand what I need coding-wise to have it show only the higher on the hierarchy groupfooter when two subtotals (memos) in different groupfooters match. Thanks for any help!
Memo15 is subtotal in another groupfooter, and memo38 is the subtotal in Groupfooter5. Memo31 is a descriptive memo for the subtotal.
Additionally, coding is not my specialty; I have almost no training in Delphi coding.
procedure GroupFooter5OnBeforePrint(Sender: TfrxComponent);
begin
if VarToStr(<EstData.Memo15>) = VarToStr(<EstData.Memo38>) then
begin
GroupFooter5.Visible := False;
end
else
begin
if VarToStr(<EstData."Location">) = '' then
begin
GroupFooter5.Visible := False;
Memo31.Visible := False;
end
else
begin
GroupFooter5.Visible := True;
Memo31.Visible := True;
end;
end;
end;