## Wednesday, June 16, 2010

### How to display arabic numbers in crystal reports

Introduction:
I was working on Arabic Project. And there is an issue to show the Arabic Number display in Crystal Report. I face this issue and i couldn't find a solution for display Arabic numbers in crystal reports so I create a Formula and use Replace function.

Background:
It may be useful for Arabic Number Display on your windows forms / Web forms.

Using the code:
stringVar StrArb := ToText({ROTT.Aux_f_3});

StrArb :=
Replace (StrArb ,"0" , "٠" );
StrArb :=
Replace (StrArb ,"1" ,"١" );
StrArb :=
Replace (StrArb ,"2" ,"٢" );
StrArb :=
Replace (StrArb ,"3" ,"٣" );
StrArb :=
Replace (StrArb ,"4" ,"٤" );
StrArb :=
Replace (StrArb ,"5" ,"٥" );
StrArb :=
Replace (StrArb ,"6" ,"٦" );
StrArb :=
Replace (StrArb ,"7" ,"٧" );
StrArb :=
Replace (StrArb ,"8" ,"٨" );
StrArb :=
Replace (StrArb ,"9" ,"٩" );

This is the easy way to convert Numbers into Arabic Number Display..
:D
Its very easy and useful :)

STEP 1:
CLICK ON FORMULA WORKSHOP ( CREATE FORMULA)

STEP 2:

Enter the Formula Name:

STEP 3:
WRITE THE FORMULA CODE FOR DISPLAY ARABIC NUMBER IN CRYSTAL REPORT
stringVar
StrArb := ToText({ROTT.Aux_f_3});
StrArb :=
Replace (StrArb ,"0" , "٠" );
StrArb :=
Replace (StrArb ,"1" ,"١" ); StrArb := Replace (StrArb ,"2" ,"٢" );
StrArb :=
Replace (StrArb ,"3" ,"٣" );
StrArb :=
Replace (StrArb ,"4" ,"٤" );
StrArb :=
Replace (StrArb ,"5" ,"٥" );
StrArb :=
Replace (StrArb ,"6" ,"٦" );
StrArb :=
Replace (StrArb ,"7" ,"٧" );
StrArb :=
Replace (StrArb ,"8" ,"٨" );
StrArb :=
Replace (StrArb ,"9" ,"٩" ); 1) Save Formula and close the formula workshop window
2) click on Field explorer
3) In

1. hi asma
thanks for your efforts to find a solution for this problem.
please if you can update the images cause its appeared broken
variable ?? can you discuss in details plz :)
thx

2. "ROTT.Aux_f_3" This is column name from my table. in which some numerical values stored . So I just pass my call and convert into Arabic Numbers.

3. If we had a a several colunms
e.g more than 5 numerical columns
what we can doing in this case

Is your formula on the level of whole report or in field level ?

4. Its for one formula filed . if you have more then 5 filed convert to Arabic then you have to create 5 formula and put on your Crystal Report.
Thanks

5. Thanks Asma

Jarir

6. Really good post!

7. does crystal support arabic ?

I called them and they said they didnt.

We have an application developed and want to allow any arabic customers to use crystal. we have since started building in jasper and its working well but prefer crystal's interface

bobr

8. how can we convert 100000 in arabic....!!!!

9. for 100000 in arabic use the same formula

10. Thanks a lot.. Asma

11. Thanks.. I was looking for this

12. Is there any localization in UFL to the function ToWords

13. No localization in UFL to the function ToWords

14. Thanks Asma, this really helped me, you should be a role model to girls in our country :)

15. Many Thanks @ Zaryan Ali

16. Hi Asma,
when i paste the Code in the forumla of the Crystal Reports 8.5 the arabic numbers appears same as the English Ones. i search in the regional settings but it turns all numbers to arabic not like the same example u gave.
Any Solution.....
Thanks

17. Hi,
No need to do anything with regional settings, you need to create forumla in Crystal Report and same you have drage and use in your Report. The forumla will convert English numbers to Arabic numbers.

Thanks,

18. When i paste the code in the formula the arabic numbers appears as the following:
StrArb := Replace (StrArb ,"0" , "0" );
StrArb := Replace (StrArb ,"1" ,"1" );
StrArb := Replace (StrArb ,"2" ,"2" );
StrArb := Replace (StrArb ,"3" ,"3" );
StrArb := Replace (StrArb ,"4" ,"4" );
StrArb := Replace (StrArb ,"5" ,"5" );
StrArb := Replace (StrArb ,"6" ,"6" );
StrArb := Replace (StrArb ,"7" ,"7" );
StrArb := Replace (StrArb ,"8" ,"8" );
StrArb := Replace (StrArb ,"9" ,"9" );

Thats my problem

19. Ooh!!
no this formula itself showing wrong.
Cannt you past my code, see the below try to copy past.

stringVar StrArb := ToText({ROTT.Aux_f_3});
StrArb := Replace (StrArb ,"0" , "٠" );
StrArb := Replace (StrArb ,"1" ,"١" );
StrArb := Replace (StrArb ,"2" ,"٢" );
StrArb := Replace (StrArb ,"3" ,"٣" );
StrArb := Replace (StrArb ,"4" ,"٤" );
StrArb := Replace (StrArb ,"5" ,"٥" );
StrArb := Replace (StrArb ,"6" ,"٦" );
StrArb := Replace (StrArb ,"7" ,"٧" );
StrArb := Replace (StrArb ,"8" ,"٨" );
StrArb := Replace (StrArb ,"9" ,"٩" );

the English numbers Replace with Arabic.
and if you couldn't type/writ Arabic number. Try to Google translate.

Thanks.

20. Hello Asma,
I Need a Function that converts numbers to letters
but in French language for wording of invoice.
If you can help me

21. Hi,

I want to convert Arbic numbers to translate to Arabic Words...
Example in english 20 to Twenty.. same thing in Arabic

22. Hi,
You can have a look on my other article convert Arbic numbers to translate to Arabic Words as you required. check on below link you can download the Project and test it.

http://asmaqureshi.blogspot.ae/2013/05/how-to-convert-numbers-to-arabic-word.html

23. Thanks for any other informative web site. The place else may just I am getting that
kind of info written in such a perfect method?

I've a project that I am simply now operating on, and I have been on the glance out for such info.

Here is my site how to scrape data

24. Hi,
I get report data from stored procedure not from table , how could i write filed name?

thanks

25. Hi,

This will be the way stored procedure or from table , just give the name what you have in SP or Table.

26. Hello...

The formula work but with long number like the year 2014 it's display ٢,٠١٤.٠٠ how can I fixed??

27. Hi Asma,

I want to convert some english characters to arabic in crystal reports, Solution will be appreciable

28. Hi,

If you have some specific English characters convert into Arabic, You can create a function in your Crystal Report and use Replace (StrArb ,"1" ,"١" ); function and give your Eng character and required arabic character .

Thanks

29. stringVar StrArb := ToText({ROTT.Aux_f_3});

StrArb := Replace (StrArb ,"0" , "?" );
StrArb := Replace (StrArb ,"1" ,"?" );
StrArb := Replace (StrArb ,"2" ,"?" );
StrArb := Replace (StrArb ,"3" ,"?" );
StrArb := Replace (StrArb ,"4" ,"?" );
StrArb := Replace (StrArb ,"5" ,"?" );
StrArb := Replace (StrArb ,"6" ,"?" );
StrArb := Replace (StrArb ,"7" ,"?" );
StrArb := Replace (StrArb ,"8" ,"?" );
StrArb := Replace (StrArb ,"9" ,"?" );

30. Hi,
I would like to inform you that English numbers are the Arabic/Islamic. For your information

31. Salam,
I like your effort and Good idea it is working.... but I am trying to use the arabic convert formula in my running totals.... issue is i cannot sum it if adding a formula in running totals... any idea ?

1. I can give you logic. you can put one hiden filed and try to sum and this Sum value you can use the Arabic number conversion

>> Step one
>> Step two
try to put formula in your Total

32. Thanks for the article... I was able to use the running total as well in your given formula and it solved my problem...
Thank you

1. 33. thank for your effort but I am trying to use the arabic convert formula in my report which has about 74 value to be arabic what can i do ?

34. thanks for help ........my report has 72 column i want to display these at Arabic what can i do ?repeat your formula 72 times
thanks a lot

35. Yes this is the solution, I also have more then 39 columns.

36. dear asma when i paste your code in formula editor arabic 0 is converting to english 0 , i copied from google translate also , still i cannot write arabic 0 in formula editor it is automatically changing to 0

below is example
StrArb := Replace (StrArb ,"0" , "0" );

can u help

37. The formula work but with long number like the year 81 it's display ٨١.٠٠ and 0 its display ٠.٠٠ how can I fixed??

38. 81 display ٨١.٠٠ (its correct)
0 display ٠.٠٠ ( here you can use if else condition , if 0 then display only '٠' )

1. I need output 81 display like ٨١ and 0 like ٠ no need of extra values

2. You need to make exact number , the number you want to showing in Arabic. In your real number their will be 81.00.
make sure your number without .00 so Arabic number will not show ' .٠٠ '

3. Hi when I am pasting Arabic characters in formula it is coming as ?

39. Hi Asma h r u?
can u plz check below problem

stringVar StrArb := ToText({ROTT.Aux_f_3});

StrArb := Replace (StrArb ,"0" , "?" );
StrArb := Replace (StrArb ,"1" ,"?" );
StrArb := Replace (StrArb ,"2" ,"?" );
StrArb := Replace (StrArb ,"3" ,"?" );
StrArb := Replace (StrArb ,"4" ,"?" );
StrArb := Replace (StrArb ,"5" ,"?" );
StrArb := Replace (StrArb ,"6" ,"?" );
StrArb := Replace (StrArb ,"7" ,"?" );
StrArb := Replace (StrArb ,"8" ,"?" );
StrArb := Replace (StrArb ,"9" ,"?" );

40. Hi Asma
Can u plz check below formula
stringVar StrArb := ToText({ROTT.Aux_f_3});

StrArb := Replace (StrArb ,"0" , "?" );
StrArb := Replace (StrArb ,"1" ,"?" );
StrArb := Replace (StrArb ,"2" ,"?" );
StrArb := Replace (StrArb ,"3" ,"?" );
StrArb := Replace (StrArb ,"4" ,"?" );
StrArb := Replace (StrArb ,"5" ,"?" );
StrArb := Replace (StrArb ,"6" ,"?" );
StrArb := Replace (StrArb ,"7" ,"?" );
StrArb := Replace (StrArb ,"8" ,"?" );
StrArb := Replace (StrArb ,"9" ,"?" );

Thanks

41. Hi Asma H r u..?
Can u plz check the below formula why ? come.
stringVar StrArb := ToText({ROTT.Aux_f_3});

StrArb := Replace (StrArb ,"0" , "?" );
StrArb := Replace (StrArb ,"1" ,"?" );
StrArb := Replace (StrArb ,"2" ,"?" );
StrArb := Replace (StrArb ,"3" ,"?" );
StrArb := Replace (StrArb ,"4" ,"?" );
StrArb := Replace (StrArb ,"5" ,"?" );
StrArb := Replace (StrArb ,"6" ,"?" );
StrArb := Replace (StrArb ,"7" ,"?" );
StrArb := Replace (StrArb ,"8" ,"?" );
StrArb := Replace (StrArb ,"9" ,"?" );

Thanks

42. Hi when I try to paste this formulae in Crystal report the Arabic letter is coming as ? what to do?

43. Hi Asma,
I want an amount to be converted to arabic in words in crystal reports. Can u Pls help me?

1. You can use the same class I created for Arabic numbers.

44. It is working fine but it is printing in English style like 1.00(١.٠٠) not (٠٠.١)

45. In Crystal Report! How about amount in word i.e. arabic???

46. Hi Asma,

I need to convery my Invoice quantity from English to Arabic. I was useing below formula. But it was showing same Emglish Number only.

stringVar StrArb := ToText({INV1.Quantity});

StrArb := Replace (StrArb ,"0" , "٠" );
StrArb := Replace (StrArb ,"1" ,"١" );
StrArb := Replace (StrArb ,"2" ,"٢" );
StrArb := Replace (StrArb ,"3" ,"٣" );
StrArb := Replace (StrArb ,"4" ,"٤" );
StrArb := Replace (StrArb ,"5" ,"٥" );
StrArb := Replace (StrArb ,"6" ,"٦" );
StrArb := Replace (StrArb ,"7" ,"٧" );
StrArb := Replace (StrArb ,"8" ,"٨" );
StrArb := Replace (StrArb ,"9" ,"٩" );

47. Hi
1) You have to use the formula which you created and
2) click on Field explorer
Then it will be in Arabic numbers.

48. Hi Asma,
Thanks for the solution it's very useful, But when use the formula the numbers are being printed as ٢,٠٠

49. i want to convert english date to hijri date in crystal reports...

50. you can use formula

51. بارك الله فيك
اخت