find memo

edited 4:44PM in FastReport 4.0
Hi, I have a report with many "memo" fields and I want to fill them with text by using this code:

var i: integer;
Memo1: TfrxMemoView;
begin
for i:=1 to 50 do
begin
memo1:= TfrxMemoView(frxReport1.FindObject(inttostr(i)));
memo1.memo.text:= inttostr(i);
end
end;

But this error message appears Undeclared Identifier : ' frxReport1'
Can anyone help me? Thanks.

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 4:44PM
    the find object method for a report is used from delphi. Usually
    after loading the report and before calling show report.
    but it may be used in other events of the tfrxreport component
    it requires a string parameter to find the object by it's name in the report.
    typically
    var i: integer;
    Memo1: TfrxMemoView;
    begin
    frxreport1.loadfromfile('path&filename');
    for i:=1 to 50 do

    begin
    memo1:= frxReport1.FindObject('memo'+inttostr(i)) as tfrxmemoview;
    memo1.memo.text:= inttostr(i);
    end;
    end

  • gpigpi
    edited 4:44PM
    Use Report.FindObject in script
  • edited 4:44PM
    It worked! Thank you very much.

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.