How to assign Delphi OnBeforePrint event handler?
Hi all!
I want to assign an OnBeforePrint handler implemented in Delphi to a TfrxPictureView at runtime, something like
How can I achieve my goal?
I want to assign an OnBeforePrint handler implemented in Delphi to a TfrxPictureView at runtime, something like
  procedure InitPicture(const AName: string);
  var
    c: TComponent;
    pict: TfrxPictureView;
  begin
    c := fastReport1.FindComponent(AName);
    if Assigned(c) and (c is TfrxPictureView) then
    begin
      pict := TfrxPictureView(c);
      pict.OnBeforePrint := Picture2BeforePrint;
    end;
  end;
with a method
  TMyClass = class(...)
    ...
    procedure Picture2BeforePrint(Sender: TfrxComponent);
    ...
  end;
but of course this doesn't work because <!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->TfrxReportComponent.OnBeforePrint<!--fontc--></span><!--/fontc--> is in fact a string property, not an event property.How can I achieve my goal?
Comments
Use TfrxReport.OnBeforePrint event for Delphi's code