How can I get memo object.

Hi,

I try to get memo object but I have a problem.

this is working:

MemoColorObj := TfrxMemoView(Page1.FindObject('Memo2'));

MemoColorObj.Color := $00111111;

but
I need to like that

TfrxMemoView(FindObject('Memo2'));

so I don't need to use "Page1" because I don't know pagename.

and


I try to that but don't work.
_______________________

memo := Report.FindObject('Memo2') as TfrxMemoView;
memo.text := 'test';
________________________

var
x: TfrxComponent;
begin
x := frxReport.Report.FindObject('Memo2');


Thanks in advance.

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 5:54PM
    where are you trying to write the code, in the report code or from Delphi?
  • edited 5:54PM
    TfrxMasterData * databand = dynamic_cast< TfrxMasterData * > (frReport->FindComponent("MasterData1"));
    memoCheckCode = dynamic_cast< TfrxMemoView * > (frReport->FindComponent("mailcheckcode"));

    this is CBC code
  • edited April 2012
    This is from Delphi.
      function FindFrxComp(AReport: TfrxReport; AName: String): TfrxComponent;
        procedure CheckComp(AComp: TfrxComponent);
        var
          i: Integer;
        begin
          if SameText(AComp.Name, AName) then
            Result := AComp
          else begin
            i := 0;
            while (Result = nil) and (i < AComp.Objects.Count) do begin
              CheckComp(AComp.Objects[i]);
              Inc(i);
            end;
          end;
        end;
      var
        i: Integer;
      begin
        Result := nil;
        i := 0;
        while (Result = nil) and (i < AReport.Report.PagesCount) do begin
          CheckComp(AReport.Report.Pages[i]);
          Inc(i);
        end;
      end;
    

    MemoColorObj := TfrxMemoView(FindFrxComp('Memo2'));

Leave a Comment