frxReport 控件加入自定义函数并显示金额大写

1. --- dConnector的 DataModuleCreate 中加入以下代码

procedure TdConnector.DataModuleCreate(Sender: TObject);
begin
   // -----------
  frpAmbKrmTalon.AddFunction('function MoneySpeech(pMoney: Currency): String;', 'Myfunction','人民币大写金额转换函数');
end;

 

2. --- dConnector.frxReport 控件的onUserFunction事件中加入以下代码

fastReport 中显示金额大写

function TdConnector.frpAmbKrmTalonUserFunction(const MethodName: string; var Params: Variant): Variant;
begin
  // ------- 金额大写
  if UpperCase(MethodName) = UpperCase('MoneySpeech') then Result := MoneySpeechC(Params[0]);

end;

 

3. --- 要显示大写金额的字段 双击 Text 录入以下代码

[(MoneySpeech(<fdsAKrmTalon."det_somma">))]

 

fastReport 中显示金额大写

 

相关文章:

  • 2021-06-24
  • 2022-12-23
  • 2021-06-19
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2021-11-13
猜你喜欢
  • 2021-11-27
  • 2022-12-23
  • 2021-06-20
  • 2021-11-13
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案