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 1:53AM
    wrote:
    But again: Is there a simpler solution?
    Yes

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.