发布时间:2025-12-10 19:40:36 浏览次数:4
FastReport 3.0 使用自定义函数FastReport3.0使用自定义函数比2.X多了一个步骤,同时函数没有参数的限制,也更清楚。假设在onUserfunction事件里响应了MYFUNC函数(摘自官方手册):functionTForm1.frxReport1UserFunction(constMethodName:String;varParams:Variant):Variant;begin
FastReport 3.0使用自定义函数比2.X多了一个步骤,同时函数没有参数的限制,也更清楚。
假设在onUserfunction事件里响应了MYFUNC函数(摘自官方手册):
function TForm1.frxReport1UserFunction( const MethodName: String ;
var Params: Variant): Variant;
begin
else if MethodName = ‘MYPROC’ then
end;
那么,我们只要先注册这个函数,就可以使用了。方法如下:
frxReport1.AddFunction(‘function MyFunc(s: String; i: Integer): Boolean’);
MYFunc函数应该像下边那样实现:
function TForm1.MyFunc(s: String ; i: Integer): Boolean;
begin
//内容略
end;