This sample demonstrates the usage of multi-language reports, i.e., reports with labels displayed in the language (locale) being used on the client computer requesting the report. It contains the following files:
LanguageResource=samples.multi_language_reports.SetLocaleSample
.class files as ListResourceBundles. If you like to use the .properties files as PropertyResourceBundles then you don't need to compile the .class files.java -classpath .:core/ClearReports.jar;. samples.multi_language_reports.SetLocaleToEngine
or start the i-net Clear Reports server as a Java application or a servlet.
“setLocale_sampleReport.rpt” from a client with English, French or German locale settings and you will see the labels of the report in the specified language. The report engine i-net Clear Reports reads the used client locale from the HTTP Header of the report request. It is also possible to set the locale in the report URL (…&locale=de) or with the method Engine.setLocale. The sample file “SetLocaleToEngine.java” shows how to do it.From the API documentation of java.utils.Properties:
“When saving properties to a stream or loading them from a stream, the ISO 8859-1 character encoding is used. For characters that cannot be directly represented in this encoding, Unicode escapes are used; however, only a single 'u' character is allowed in an escape sequence. The native2ascii tool can be used to convert property files to and from other character encodings.”
If you have property files saved in Unicode or UTF-8 encoding then you can use the native2ascii tool which is part of the JDK to convert your property files, e.g.:
i-net software strives to provide accurate product documentation. Please give us your feedback using the form below.
NOTE: This form is for documentation feedback only. For technical assistance, please send an email to clearreports@inetsoftware.de.