how to access a band by its name?

It seems that TfrBand does not have a property 'Name', so the following does not work:
procedure TrepRoomTraffic.frReportEndBand(Band: TfrBand);
begin
if Band.Typ =btGroupFooter  then
   begin
     if Band.name='GroupFooterUser' then
        FUserTotalTime:=0
     else
        if Band.Name='GroupFooterRoom' then
           FUserTotalRoomTime:=0;
   end;
end;
Any suggestions how to reset variables on leaving/entering band

Comments

  • edited 2:33AM
    Hi!

    I always use the internal pascal interpreter to initialize or reset variables. Every kind of band has the OnBeforePrint event that is useful for operations like this.

    Regards:Alex
  • gordkgordk St.Catherines On. Canada.
    edited 2:33AM
    i assume the fusertime variables are external to the report.
    the problem is your code

    procedure TForm1.frReport5EndBand(Band: TfrBand);
    begin
    if Band.Typ =btGroupFooter then
    begin
    if band.Name = 'GroupFooterUser' then
    begin
    //do whatever here
    end;

    if band.name = 'GroupFooterRoom' then
    begin
    // do whatever here
    end;
    end;
    end;
    works fine
    regards
    ;)

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.