iReport Ultimate Guide - Nimsoft Library
iReport Ultimate Guide - Nimsoft Library iReport Ultimate Guide - Nimsoft Library
iReport Ultimate Guideresource 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 valueiReport 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
InternationalizationFigure 17-2Creating a new resource bundleSelect the file name and where to save it. When done, iReport will open the file as simple text file (see Figure 17-3).Figure 17-3The new resource bundleThis is just the default bundle. To add new languages or switch to the visual editor for resource bundles, you need to locate thefile using the Favorites window. Select Window→Favorites to open the Favorites view, and locate the resource bundle filedirectory. It is important that you add the containing directory, not the file itself; otherwise you’ll be not able to see thelanguage specific bundles (see Figure 17-4).325
- Page 273 and 274: Flash ChartsFigure 13-46 Specifying
- Page 275 and 276: Flash ChartsFigure 13-49 Specifying
- Page 277 and 278: Lists, Tables, and BarcodesCHAPTER
- Page 279 and 280: Lists, Tables, and BarcodesFor your
- Page 281 and 282: Lists, Tables, and Barcodesidentifi
- Page 283 and 284: Lists, Tables, and BarcodesList ele
- Page 285 and 286: 14.2 TablesLists, Tables, and Barco
- Page 287 and 288: Lists, Tables, and BarcodesiReport
- Page 289 and 290: Lists, Tables, and BarcodesFigure 1
- Page 291 and 292: Lists, Tables, and BarcodesSimilarl
- Page 293 and 294: Lists, Tables, and BarcodesFigure 1
- Page 295 and 296: Lists, Tables, and BarcodesFigure 1
- Page 297 and 298: Lists, Tables, and BarcodesWhen usi
- Page 299 and 300: SubdatasetsCHAPTER 15 SUBDATASETSRe
- Page 301 and 302: SubdatasetsUR permits you to use a
- Page 303 and 304: SubdatasetsFigure 15-7Initial layou
- Page 305 and 306: SubdatasetsFigure 15-11 Pie dataset
- Page 307 and 308: CrosstabsCHAPTER 16 CROSSTABSA cros
- Page 309 and 310: CrosstabsUsing the Crosstab Wizard,
- Page 311 and 312: CrosstabsFigure 16-6Outline tree vi
- Page 313 and 314: CrosstabsFigure 16-8Adding a Row Gr
- Page 315 and 316: CrosstabsFigure 16-11 Empty row tot
- Page 317 and 318: CrosstabsFigure 16-16 Crosstab Prop
- Page 319 and 320: CrosstabsFigure 16-19 Crosstab Data
- Page 321 and 322: CrosstabsFigure 16-22 The result of
- Page 323: InternationalizationCHAPTER 17 INTE
- Page 327 and 328: InternationalizationFigure 17-6New
- Page 329 and 330: InternationalizationFigure 17-7Loca
- Page 331 and 332: ScriptletsCHAPTER 18 SCRIPTLETSA sc
- Page 333 and 334: ScriptletsTable 18-1Report eventsEv
- Page 335 and 336: ScriptletsFigure 18-3Adding a Jar t
- Page 337 and 338: ScriptletsFigure 18-5Build output18
- Page 339 and 340: ScriptletsIf you want to add more s
- Page 341 and 342: ScriptletsThis is what you get in t
- Page 343 and 344: Scriptletsterminates the report exe
- Page 345 and 346: Additional ToolsCHAPTER 19 ADDITION
- Page 347 and 348: Additional ToolsFigure 19-3Date and
- Page 349 and 350: Additional ToolsFigure 19-4Percenta
- Page 351 and 352: 19.5 How to Run the SamplesAddition
- Page 353 and 354: Chart Theme ExampleAPPENDIX ACHART
- Page 355 and 356: Chart Theme ExampleCode Example A-1
- Page 357 and 358: IndexINDEXAAdd selected field(s) 20
- Page 359 and 360: Indexcomponents 241embedded in Java
- Page 361 and 362: Indexscriptlets 53sheets. See prope
InternationalizationFigure 17-2Creating a new resource bundleSelect the file name and where to save it. When done, <strong>iReport</strong> will open the file as simple text file (see Figure 17-3).Figure 17-3The new resource bundleThis is just the default bundle. To add new languages or switch to the visual editor for resource bundles, you need to locate thefile using the Favorites window. Select Window→Favorites to open the Favorites view, and locate the resource bundle filedirectory. It is important that you add the containing directory, not the file itself; otherwise you’ll be not able to see thelanguage specific bundles (see Figure 17-4).325