13.07.2015 Views

iReport Ultimate Guide - Nimsoft Library

iReport Ultimate Guide - Nimsoft Library

iReport Ultimate Guide - Nimsoft Library

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>iReport</strong> <strong>Ultimate</strong> <strong>Guide</strong>resource defined for the report. The Resource Bundle Base Name is specified using the report property sheet as shown inFigure 17-1.Figure 17-1The Resource Bundle Base Name propertyWhen you need to generate a report using a specific locale, UR looks for a file starting with the Resource BundleBase Name string, followed by the language and country code relative to the requested locale. For example,i18nReport_it_IT.properties is a file that contains all locale strings to print in Italian; in contrast,i18nReport_en_US.properties contains the translations in American English. * So it’s important to always create adefault resource file that will contain all the strings in the most widely-used language and a set of language-specific files forother languages.The default resource file does not have a language/country code after the Resource Bundle Base Name, and the containedvalues are used only if there is no resource file that matches the requested locale, or if the file does not include the key for atranslated string.The complete resource file name is composed as follows:[_language code[_country code[_other code]]].propertiesHere are some examples of valid resource file names:i18nReport_fr_CA_UNIXi18nReport_fr_CAi18nReport_fri18nReport_en_USi18nReport_eni18nReportThe “other” code (or alternative code) is usually not used for reports, but it is included to identify very specific resource files.The alternative code is appended after the language and the country code ( _UNIX in the preceding example).If a resource key is not found in any of the suitable resource bundles, you can choose what to do by setting the report propertyWhen Resource Missing Type. The possible options are:Type NullType EmptyRaise an errorType the keyThe null value is used in the expression (resulting in the string “null”)The empty string is usedThis will stop the filling process throwing a Java exceptionThe value of the key is used as value<strong>iReport</strong> provides built-in support for editing the resource bundle files used for report localization.To create a new resource bundle, select New → Resource Bundle (see Figure 17-2).* The language codes are the lower-case, two-letter codes as defined by ISO-639 (a list of this codes is available at this site: http://www.loc.gov/standards/iso639-2/php/English_list.php), the country codes are the upper-case, two-letter codes as defined by ISO-3166(a list of this codes is available at this site: http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html).324

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!