how to create an event onbeforeprint in runtime
procedure beforeprint(sender:tfrxcomponent);
masterdata.OnBeforePrint := 'beforeprint(nil)';
procedure trelatorio.beforeprint(sender:tfrxcomponent);
begin
showmessage('evento beforeprint executado'); // or some other thing
end;
=========
why it does not work, and why i need to set [OnBeforePrint := 'beforeprint(nil)';] like a String?
Its realy strange, and here i tryied to do it in many different ways, but always receive an error...
i just wanna set the OnBeforePrint in Runtime, and nothing more.
Can anyone help me?
masterdata.OnBeforePrint := 'beforeprint(nil)';
procedure trelatorio.beforeprint(sender:tfrxcomponent);
begin
showmessage('evento beforeprint executado'); // or some other thing
end;
=========
why it does not work, and why i need to set [OnBeforePrint := 'beforeprint(nil)';] like a String?
Its realy strange, and here i tryied to do it in many different ways, but always receive an error...
i just wanna set the OnBeforePrint in Runtime, and nothing more.
Can anyone help me?
Comments
code:
but... do not work [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> any idea?[/img]
thanks gpi,
but dont work.
unit classerelatorio;
interface
uses ....
type
trelatorio = class(tobject)
procedure add_detail;
...
...
...
private
procedure masterdata1onbeforeprint(sender: tfrxcomponent);
public
end;
...
var
relatorio : trelatorio;
implementation
uses
...
procedure trelatorio.add_detail;
var
masterdata : tfrxmasterdata;
begin
masterdata := tfrxmasterdata.create(frxreportpage);
masterdata.name := 'masterdata1';
masterdata.dataset := dataset;
masterdata.onbeforeprint := 'masterdata1onbeforeprint'; // its correct ???
end;
procedure masterdata1onbeforeprint(sender:tfrxcomponent);
begin
// code....
end;
in the tfsscript ?
any example ?
here is a sample.
Very pleased with your help.
thank you gpi
its running [img]style_emoticons/<#EMO_DIR#>/cool.gif" style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" /> thanks gordk, gpi and galdariah[/img]
I'm trying to add event to memoview at runtime, but cannot find way to assign event.
I'm using VB6 and creating report at runtime with several memoviews.
I have added script to report object, which has some variables and procedures.
Now i want to assign one of script procedure to obp event of memoview.
but cant find way to do so. my fastreport version is 4.9
Please help me.
Thanks in advance.