find memo
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.
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
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