Access items in code

Hi All,

I know it is possible to access a component in FastReports with
Memo1 := frxReport1.FindObject('Memo1') as TfrxMemoView;

But is it also possible to access a couple of TfrxMemoView objects in a loop like:

For Counter := 0 to frxReportTitle.ComponentCount-1 do
If frxReportTitle.Components[Counter] = TfrxMemoView
Then frxReportTitle.Components[Counter].Visible := False;

I tried something like this but I don't know how to fill in the rest of the code

For Counter := 0 to frxReportTitle.Objects.Count-1 do
If .........
Then .............

Thanks in advance.

Peter

Comments

  • edited September 2011
    var    
      pw: TfrxComponent;
    begin
      pw := frxReport1.FindObject('MyImage');
      if (pw is TfrxPictureView) then begin
        ....
      end;
    end;
    
  • edited 6:08PM
        procedure Find(frxComp: TfrxComponent);
        var
          i: Integer;
          loc_frxComp: TfrxComponent;
        begin
          for i := 0 to frxComp.Objects.Count - 1 do begin
            loc_frxComp := frxComp.Objects[i];
            if (loc_frxComp is TfrxMemoView) then begin
    
            end;
            Find(loc_frxComp);
          end;
        end;
    begin
      Find(frxReport1);
    end;
    

Leave a Comment