水晶报告的货币问题

时间:2011-06-19 16:35:14

标签: crystal-reports

您好我已经在asp.net网站上开发了水晶报告 我想设置货币格式,如1,20,000(印度货币),但现在货币采取我的服务器托管货币格式,我在印度公司工作所以我有任何格式转换印度格式的货币水晶报告//

1 个答案:

答案 0 :(得分:1)

-- You can use below said code to your report part;

CStr({@FieldName}, "##,##,##,###.##")

And you are working for Indian Company, you will needed in words also. To write in words, use below said code;

numbervar RmVal:=0; 
numbervar Amt:=0; 
numbervar pAmt:=0; 
stringvar InWords :="Rupees "; 

Amt := {@FieldName}  ; 


if Amt > 10000000 then RmVal := truncate(Amt/10000000); 
if Amt = 10000000 then RmVal := 1; 

   if RmVal = 1 then 
        InWords := InWords + " " + towords(RmVal,0) + " crore" 
   else 
        if RmVal > 1 then InWords := InWords + " " + towords(RmVal,0) + " crores"; 


    Amt := Amt - Rmval * 10000000; 

    if Amt > 100000 then RmVal := truncate(Amt/100000); 
    if Amt = 100000 then RmVal := 1; 

    if RmVal = 1 then 
        InWords := InWords + " " + towords(RmVal,0) + " lakhs"
    Else
        If RmVal > 1 then InWords := InWords + " " + ToWords(RmVal,0) + " Lakhs";

        Amt := Amt - Rmval * 100000; 

        if Amt > 0 then InWords := InWords + " " + towords(truncate(Amt),0); 

        pAmt := (Amt - truncate(Amt)) * 100; 

        if pAmt > 0 then 
            InWords := InWords + " and " + towords(pAmt,0) + " paisa only" 
        else 
            InWords := InWords + " only"; 

        ProperCase(InWords)