以下摘自FR240自带的FAQ:
Q: How I can add my own function?
A: Use TfrReport.OnUserFunction event. Here is simple example:
procedure TForm1.frReport1UserFunction(const Name: String;
p1, p2, p3: Variant;
var val: Variant);
begin
if AnsiCompareText('SUMTOSTR', Name) = 0 then
val := My_Convertion_Routine(frParser.Calc(p1));
end;
After this, you can use SumToStr function in any place of report
(in any expression or script).