Jump to content
We've recently updated our Privacy Statement, available here ×
  • Adding Additional Currencies to Ad-Hoc Domains


    ernestoo
    • Features: Ad Hoc Version: v5.1.0 Product: JasperReports® Server

    Overview

    This short article describes how to add additional currencies to ad-hoc reports. This doesn't cover something like a generic currency field which is on the spot converted to the user's current Locale-  (you can do that by developing a Groovy function though!)This assumes you have fields like amount_usd, amound_euro, amoung_gbp and want to assign a different mask to the field like $, €, or £

    How-To

    You will need to edit the locale file that is associated with the locale that you want to edit. In my case I want to edit the default locale so I edited the file /webapps/jasperserver-pro/WEB-INF/bundles/adhoc_masks.properties if you wanted to edit the spanish one you would edit adhoc_masks_es.properties

    Add the additonal currencies like you see here for integers and decimals:

     

    ADH_100_MASK_int_0 = #,##0
    ADH_100_MASK_int_1 = 0
    ADH_100_MASK_int_2 = $#,##0;($#,##0)
    ADH_100_MASK_int_3 = u20ac#,##0;(u20ac#,##0)
    ADH_100_MASK_int_4 = u00a3#,##0;(u00a3#,##0)
    ADH_100_MASK_int_5 = #,##0;(#,##0)
     
    ADH_100_MASK_dec_0 = #,##0.00
    ADH_100_MASK_dec_1 = 0
    ADH_100_MASK_dec_2 = $#,##0.00;($#,##0.00)
    ADH_100_MASK_dec_3 = $#,##0;($#,##0)
    ADH_100_MASK_dec_4 = u20ac#,##0.00;(u20ac#,##0.00)
    ADH_100_MASK_dec_5 = u20ac#,##0;(u20ac#,##0)
    ADH_100_MASK_dec_6 = u00a3#,##0.00;(u00a3#,##0.00)
    ADH_100_MASK_dec_7 = u00a3#,##0;(u00a3#,##0)
     

    See Also

    JasperReports Server Administrator Guide - Section C.3.3 Changing Format Masks and Date Formats
     

    End Result

    Here's an example in ad-hoc, this will also export properly to PDF, etc

    ScreenShot2012-10-05at5_59_19PM.png.77ea4b9d2211b36cfa152fc93d03ad71.png


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...