Allowslip選True (跨頁打印) MasterData1的Stretched設置為True;(設置對象可以拉伸) 所有Memo的StretchMode設置為smMaxHeight(自動拉伸到最高高度);WordWrap為True;(自動換行) FastReport調用Delphi中的人民幣大寫轉換自定義函數 function TJzpzEdit1.MoneyCn(mmje: Double): string; const s1: string = ‘零壹貳三肆伍陸柒捌玖’; s2: string = ‘分角元拾佰仟萬拾佰仟億拾佰仟萬’; function StrTran(const S, s1, s2: string): string; begin Result := StringReplace(S, s1, s2, [rfReplaceAll]); end; var S, dx: string; i, Len: Integer; begin if mmje < 0 then begin dx := ‘負’; mmje := -mmje; end; S := Format(‘%.0f’, [mmje * 100]); Len := Length(S); for i := 1 to Len do dx := dx + Copy(s1, (Ord(S[i]) – Ord(’0′)) * 2 + 1, 2) + Copy(s2, (Len – i) * 2 + 1, 2); dx := StrTran(StrTran(StrTran(StrTran(StrTran(dx, ‘零仟’, ‘零’), ‘零佰’, ‘零’), ‘零拾’, ‘零’), ‘零角’, ‘零’), ‘零分’, ‘整’); dx := StrTran(StrTran(StrTran(StrTran(StrTran(dx, ‘零零’, ‘零’), ‘零零’, ‘零’), ‘零億’, ‘億’), ‘零萬’, ‘萬’), ‘零元’, ‘元’); if dx = ‘整’ then Result := ‘零元整’ else Result := StrTran(StrTran(dx, ‘億萬’, ‘億零’), ‘零整’, ‘整’); end; ////////// procedure TJzpzEdit1.FormCreate(Sender: TObject); begin frxReport1.AddFunction(‘function MoneyCn(mmje: Double): String;’,'Myfunction’,'小寫金額轉大寫的函數’); end; ////////// function TJzpzEdit1.frxReport1UserFunction(const MethodName: string; var Params: Variant): Variant; begin if UpperCase(MethodName) = UpperCase(‘MoneyCn’) then Result := MoneyCn(Params[0]); end; ////////// 報表中調用方法 MoneyCn(50000000)