onbeforeprint in report designer

hello,

i have onbeforeprint event in report. event is fired right, picture is assigned. but only in report preview and report print.
How to use before print event in designer? if i click preview from designer, picture is not assigned.
Is there any beforeprint event in designer component?
thx

my code is:

procedure TREPO.report_on_beforeprint(Sender: TfrxReportComponent);
begin
if pos('_USER_SIGN_',AnsiUpperCase(sender.Name))>0 then
begin
sign_stream.Position:=0;
if sender is tfrxpictureview then
begin
tfrxpictureview(sender).Picture.Bitmap.LoadFromStream(sign_stream);
end;
end;
end;

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 5:35AM
    if you are in the desinmode in the ide environment you cannot expect delphi code to run you must
    have your exe running. to do what you want you must have the code internal to the report.
  • edited 5:35AM
    i think, i was not clear enough.

    my EXE is running. delphi IDE is off. in my app i click button to show report designer.
    then, in designer i design report, then click preview button (still in designer), report is showen but previous delphi code is not fired.

    where can i connect onbeforeprint event to report in designer component?

    in my app i have (and is ok)
    ownreport.onbeforeprint:=report_on_beforeprint

    what i need is same for report designer (running from my app):
    owndesign.?previewedreport?.onbeforeprint:=....?

    txh
  • gordkgordk St.Catherines On. Canada.
    edited 5:35AM
    what version of fr are you running?
    internal code and events is not available in xe or basic versions. only standard and above.
  • gordkgordk St.Catherines On. Canada.
    edited 5:35AM
    NOTE
    Your code should run
    I expect the problem you are having is that you are not calling design report
    in the context of the tfrxreport component that has the obpevent code.
  • edited 5:35AM
    you are absolutly right.
    it was wrong instance of report.
    now it's OK.

    thank you very much
    hm

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.