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 1:53PM
    where are you trying to write the code, in the report code or from Delphi?
  • edited 1:53PM
    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

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.