1. 在 FormCreate 中向 FastReprot 添加函数 (fPrint) 窗口
procedure TfPrint.FormCreate(Sender: TObject);
frxReport1.AddFunction(function MoneySpeechC(pMoney: Currency): String;,Myfunction, 人民币大写金额转换函数);
end;
2. 在 FastReport 用户函数事件中添加 OnUserFunction
- function TfPrint.frxReport1UserFunction(const MethodName: string; var Params: Variant): Variant;
- begin
- if UpperCase(MethodName) = UpperCase(MoneySpeechC) then
- Result := MoneySpeechC(Params[0]);
- end;
3. 在 FastReport , memo6 的 OnAfterData 事件中插入如下代码
- procedure Memo6OnAfterData(Sender: TfrxComponent);
- begin
- //-------
- memo6.text := MoneySpeechC(memo6.Value);
- end;
来源: http://www.bubuko.com/infodetail-2530538.html