Crystal Report: Convert Amount in Words

Updated on     Kisan Patel

Problem:
How to Convert Amount in Words in Crystal Report?

Solution:
First, Create a Formula in the Crystal Reports with any Name Like “In Words”.

Then Paste the Below Query in the Formula Editor of the Above Created Field and Replace the {DataTable.TotalAmount} Field with field you want to convert then insert the field in the crystal report and you will get the amount in Words in Indian Format.

numbervar RmVal:=0; 
numbervar Amt:=0; 
numbervar pAmt:=0; 
stringvar InWords :="Rupees "; 
Amt := ({DataTable.TotalAmount});

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";

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"; 

UPPERCASE(InWords)

Here is the output…

crystal-report-demo


SAP Crystal Report

Leave a Reply