FastReport调用Delphi中的自定义函数

//定义一个函数;

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;