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 9:19AM
        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

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.