在fastreport中加入自定義函數。

procedure TForm1.FormCreate(Sender: TObject);

begin  

frxReport1.AddFunction('function CurrToBigNum(Value:Extended):string', '財務', '把數值轉換成中文大寫金額');

end;

function TForm1.frxReport1UserFunction(const MethodName: String;  var Params: Variant): Variant;

begin     

if LowerCase(MethodName)='currtobignum' then   

 begin       

 if not VarIsNull(Params) then        

   Result := CurrToBIGNum(Params[0]);   

 end   

else if LowerCase(MethodName)='smalltobig' then   

    if not VarIsNull(Params) then      

    Result := SmallToBig(Params[0]);

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章