pascal - How to write events of "fastreport band" in delphi code -
i have masterdata band in fastreport. can write code on "masterdata after print" in pascal script, want know there way write code in main delphi form.
pascal script:
procedure masterdataonafterprint(sender : tfrxcomponent) begin sup_page.text := 'cont on page ' + inttostr(<page> + 1); end;
you have different options interfer report while printing.
might use events afterprint
and/or beforeprint
provide component parameter every time printed.
if want access component 1 provided in events, can use findcomponent delivering component page printed.
access functions within report can call calc
functions name parameter .
other option depending on demands use getvalue
event which, called every time variable evaluated, providing name of variable , var parameter value, enable return value like.
short example might useful:
procedure tformordm.frxreport1afterprint(sender: tfrxreportcomponent); begin // if sender tfrxmasterdata // filter out masterdatasets if sender.name = 'masterdata1' // filter out specific masterdatasets begin tfrxmemoview(frxreport1.findcomponent('sup_page')).text := 'cont on page ' + floattostr(frxreport1.calc('<page>') + 1); end; end; procedure tformordm.frxreport1beforeprint(sender: tfrxreportcomponent); begin // place might use acsess components end; procedure tformordm.frxreport1getvalue(const varname: string; var value: variant); begin if varname = 'myvalue' // own variable defined in report value := 'cont on page ' + floattostr(frxreport1.calc('<page>') + 1); end;
Comments
Post a Comment