Example that shows how to localize strings and formatting based on data from the data source or para
This is an update to this DevShare: http://developer.actuate.com/community/forum/index.php?/files/file/720-advance-localization-technique/<br />
<br />
BIRT will automatically localize strings (if you setup property files) and formatting (dates, numbers...). However in some cases you want to localize based on data or parameters different than the locale of the user running/viewing the report.<br />
<br />
There are two examples attached. One that localizes based on data, the other based on a parameter. The reports were developed in iHub3 (BIRT 4.2), however the same technique can be used in earlier releases.<br />
<br />
The code for the label strings looks like this:
The code for data formatting looks like this:
<br />
BIRT will automatically localize strings (if you setup property files) and formatting (dates, numbers...). However in some cases you want to localize based on data or parameters different than the locale of the user running/viewing the report.<br />
<br />
There are two examples attached. One that localizes based on data, the other based on a parameter. The reports were developed in iHub3 (BIRT 4.2), however the same technique can be used in earlier releases.<br />
<br />
The code for the label strings looks like this:
importPackage(Packages.java.util);lc = new Locale(this.getRowData().getColumnValue("Locale")); this.text = reportContext.getMessage(this.text, lc);<br />
The code for data formatting looks like this:
this.getStyle().numberLocale = this.getRowData().getColumnValue("Locale");
0
Categories
- All Categories
- 108 Developer Announcements
- 53 Articles
- 106 General Questions
- 144 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 899 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 120 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management