GetSubReports
I am loading templates dynamically. When load I call ppReport.GetSubReports
so I can get a list of sub reports. Through the object property I cast to a
TppSubReport and set the OnPrint event to a method on my form ( procedure
DoStuff(Sender: TObject) ) but this isn't being called. If I set up a report
in code a wire up the event handlers within the IDE it works fine.
Any help greatly appreciated
so I can get a list of sub reports. Through the object property I cast to a
TppSubReport and set the OnPrint event to a method on my form ( procedure
DoStuff(Sender: TObject) ) but this isn't being called. If I set up a report
in code a wire up the event handlers within the IDE it works fine.
Any help greatly appreciated
This discussion has been closed.
Comments
Template.OnLoadEnd event.
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
standard TNotifyEvent so I can't see why it would get called this way. Is it
actually possible to wire up an event this way as maybe the getsubreports
doesn't actually give you a handle to the subreports that are about to be
used. Are they a copy?
"Alexander Kramnik (Digital Metaphors)" wrote
the subreport, not the subreport itself. Try the code below:
var
lSubreports: TStringList;
liIndex: Integer;
begin
lSubreports := TStringList.Create;
ppReport1.GetSubReports(lSubreports);
for liIndex := 0 to lSubreports.Count-1 do
TppSubReport(TppChildReport(lSubreports.Objects[liIndex]).Parent).OnPrint :=
ppSubReport1Print;
lSubreports.Free;
end;
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com