码迷,mamicode.com
首页 > Windows程序 > 详细

FastReport调用Delphi中的自定义函数

时间:2017-05-05 00:47:20      阅读:257      评论:0      收藏:0      [点我收藏+]

标签:自定义函数   result   strong   create   加载   case   ast   ams   use   

//定义一个函数;

function SmallToMoney(akey: real): string;

begin

  //‘1234500‘

end;

 

//此处为fastreport加载自定义函数以便引用

procedure Tprint_from.FormCreate(Sender: TObject);
begin
  frxReport1.AddFunction(‘function SmallToMoney(akey: real): string;‘, ‘Myfunction‘, ‘函数功能说明‘);
end;

 

//为fastreport调用自定义函数。

function Tprint_from.frxReport1UserFunction(const MethodName: string;  var Params: Variant): Variant;
begin
   if UpperCase(MethodName) = UpperCase(‘SmallToMoney‘)  then  Result := SmallToMoney(Params[0]);
end;

FastReport调用Delphi中的自定义函数

标签:自定义函数   result   strong   create   加载   case   ast   ams   use   

原文地址:http://www.cnblogs.com/foyemeizhe/p/6810586.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!