How to count the number of groups in a report

edited January 2019 in FastReport VCL
Hi,

I have the following problem:

I designed a report with Groups and a ReportSummary-Band. The ReportSummary-Band should only be visible if their are more than one groups are printed. So my question is how can I find out - before the summary is printed - how many groups have been produced? Is there a function for that or have I count the groups by myself?

Ok. The solution I use in the Moment is a script like this:
var              
  GroupCount : Integer = 0;                                                  

procedure ReportSummaryOnBeforePrint(Sender: TfrxComponent);
begin
  ReportSummary.Visible := GroupCount > 1;                                                   
end;

procedure gfHeatsOnAfterPrint(Sender: TfrxComponent);
begin
  GroupCount := GroupCount + 1;                                                            
end;

begin
end.

But again: Is there a simpler solution?
Alex

Comments

  • gpigpi
    edited 8:22PM
    wrote:
    But again: Is there a simpler solution?
    Yes

Leave a Comment