Jump to content
Changes to the Jaspersoft community edition download ×
  • How to show 'pure' arabiс numbers in the report


    akonkin
    • Features: Localization Product: iReport Designer

    In this article I want to share the information that I've received from our engineering team as the

    answer to our customer's question that I quote below:

    Q:

    "I developed a Report using Ireport which has arabic language bundle loaded. All the texts have been converted to arabic symbols. However the numbers such as total sum amount, count amount, and other numbers showing on Ireport does not convert.

    Is there a setting to do this for converting english numbers to arabic symbol numbers?"

    On the picture below is shown a sample with the arabic letters and the non-arabic numbers

    numbers_letters.png.46e8356955a2bf6dcc1000d3e583c03d.png

    The customer means the numbers the sample of which is shown on the picture below

    (arabic numbers are on the right side of the columns):

    arabic-numbers.jpg.ea78421e9ea9b90c219d77bd14a9a0ae.jpg

    A:

    "Sun JREs do not include Farsi/Iran in the list of supported locales.
    And even for Arabic languages/locales, the Java number formatters use
    western "arabic" numerals and not proper arabic numerals.

    JR relies on the Java functionality to format numbers, and doesn't add
    any functionality on top of it. Therefore Farsi and Arabic reports will
    show western numerals by default.

    To change that, this solution should be coded as an implementation of
    net.sf.jasperreports.engine.util.FormatFactory, and set the
    formatFactoryClass JRXML attribute to the classname.

    Please note that the format factory class that you can find in the attachments

    only deals with Farsi, and produces Persian numerals (which differ slightly from proper
    Arabic numerals).
    Adapting it for Arabic is easy though, all you need is another if with
    "ar" instead of "fa" and 'u0660' instead of 'u06f0'."

    Please find the sample of such class in the attachments to this article.

     

     

     

     

    farsiformatfactory.java


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...