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;
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
have your exe running. to do what you want you must have the code internal to the report.
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
internal code and events is not available in xe or basic versions. only standard and above.
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.
it was wrong instance of report.
now it's OK.
thank you very much
hm