How to find all Memos in Report with a given TagStr using PascalScript
How can I find (and update) all Memos with a given TagStr in the report using PascalScript?
Using the following Code only Memos in the same band as the sender are found:
procedure Memo42OnPreviewClick(Sender: TfrxView; Button: TMouseButton; Shift: Integer; var Modified: Boolean);
var
p: TfrxComponent;
i: Integer;
begin
p := Sender.Parent;
if p = nil then Exit;
for i := 0 to p.Objects.Count - 1 do
if (p.Objects[i] is TfrxMemoView) and (TfrxMemoView(p.Objects[i]).TagStr = 'Something') then
begin
TfrxMemoView(p.Objects[i]).Text := 'Hello World!';
Report.Preview.Invalidate;
end;
end;
Comments
By using
p := Sender.parent.parent
I get the TfrxReportPage object, but using this will only find all the object of the reports page.
Now I'm stuck at getting all the report pages and there objects, any clues?
Ok, got it.
Loop through all preview pages and their objects: