Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
localization of dynamically generated values in scripts
opa
<p>Hi,</p><p> </p><p>I'm working with BIRT 4.2.0 in an Eclipse environment. I got the task to localize some existing reports. Localization of static parts was easy done with property files, also localization of simple dynamic values with onCreate scripts, like table cells, but now I'm at a point where these ways don't work (from my point of view).</p><p> </p><p>I have some chart titles generated in onRender scripts, like "KPI-overview from 2013-06-01 to 2013-07-01 (ave 95.7 %, min 93.4%, max 98.1 %)". The dates are coming from parameters, the percent values are calculated directly in the script. I know how to get the locale.</p><p> </p><p>Now I need (if possible) a code example how to localize the dates and the percent values in this script. I already found the two excellent topics in this forum, but they didn't help me with my special problem - or I missed the connection between the examples and my problem ;-)</p><p> </p><p>Thanks in advance,</p><p>Jörg</p>
Find more posts tagged with
Comments
micajblock
<p>Maybe this code snippet will help you</p><div><pre class="_prettyXprint">l = new java.util.Locale(row["Language"],row["Country"]);if (row["ValueFormat"] == "Currency") {nf = new java.text.NumberFormat.getCurrencyInstance(l);}else if (row["ValueFormat"] == "Percent") {nf = new java.text.NumberFormat.getPercentInstance(l);}else if (row["ValueFormat"] == "Integer") {nf = new java.text.NumberFormat.getIntegerInstance(l);}else {nf = new java.text.NumberFormat.getInstance(l);}nf.format(row["ValueColumn"]);</pre></div>