iReport Ultimate Guide - Nimsoft Library
iReport Ultimate Guide - Nimsoft Library iReport Ultimate Guide - Nimsoft Library
iReport Ultimate GuideFigure 16-23 A second field has been added in the measure cell to show the percentageFigure 16-24 The final report with percentages included322
InternationalizationCHAPTER 17 INTERNATIONALIZATIONInternationalization is the process by which applications are made acceptable for multiple cultures. The most important changethat should be made to an application is the language of the UI and output. This part of internationalization is generally called“localizing.” In iReport, localizing a report requires making all static text that is set at design time, such as labels andmessages, adaptable to locale options at run time; the report engine will print the text using the most appropriate availabletranslation. The text translations in the different languages supported by the report are stored in resource files called “resourcebundles.” This chapter covers localizing reports and explains using the built-in function msg() to localize very complexsentences created dynamically.This chapter has the following sections:• Using a Resource Bundle Base Name• Retrieving Localized Strings• Formatting Messages• Deploying Localized Reports• Generating a Report Using a Specific Locale and Time Zone17.1 Using a Resource Bundle Base NameWhen you internationalize a report, it’s necessary to find all the display text included in the report design that needs to becustomized, such as labels and static strings. A key (a name) is associated with every text fragment and is used to recall thesefragments. These keys and the relative text translation are written in special files (one per language). Below is an example of atext localization mapping file:Title_GeneralData=General DataTitle_Address=AddressTitle_Name=NameTitle_Phone=PhoneAll files containing this information have to be saved with the .properties file extension. The effective file name (that is,the file name without the file extension and the language/country code, which you will see later in this section) represents thereport Resource Bundle Base Name (for example, the Resource Bundle Base Name for the resource filei18nReport.properties is i18nReport). When you generate an instance of the report, the report engine will look in theclasspath for a file that has the Resource Bundle Base Name plus the .properties extension (so, for the previous example, itwill look for a file named i18nReport.properties). If the report engine cannot find the file, it uses the default mapping323
- Page 271 and 272: Flash ChartsFigure 13-43 Example of
- 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: CrosstabsFigure 16-22 The result of
- Page 325 and 326: InternationalizationFigure 17-2Crea
- 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
InternationalizationCHAPTER 17 INTERNATIONALIZATIONInternationalization is the process by which applications are made acceptable for multiple cultures. The most important changethat should be made to an application is the language of the UI and output. This part of internationalization is generally called“localizing.” In <strong>iReport</strong>, localizing a report requires making all static text that is set at design time, such as labels andmessages, adaptable to locale options at run time; the report engine will print the text using the most appropriate availabletranslation. The text translations in the different languages supported by the report are stored in resource files called “resourcebundles.” This chapter covers localizing reports and explains using the built-in function msg() to localize very complexsentences created dynamically.This chapter has the following sections:• Using a Resource Bundle Base Name• Retrieving Localized Strings• Formatting Messages• Deploying Localized Reports• Generating a Report Using a Specific Locale and Time Zone17.1 Using a Resource Bundle Base NameWhen you internationalize a report, it’s necessary to find all the display text included in the report design that needs to becustomized, such as labels and static strings. A key (a name) is associated with every text fragment and is used to recall thesefragments. These keys and the relative text translation are written in special files (one per language). Below is an example of atext localization mapping file:Title_GeneralData=General DataTitle_Address=AddressTitle_Name=NameTitle_Phone=PhoneAll files containing this information have to be saved with the .properties file extension. The effective file name (that is,the file name without the file extension and the language/country code, which you will see later in this section) represents thereport Resource Bundle Base Name (for example, the Resource Bundle Base Name for the resource filei18nReport.properties is i18nReport). When you generate an instance of the report, the report engine will look in theclasspath for a file that has the Resource Bundle Base Name plus the .properties extension (so, for the previous example, itwill look for a file named i18nReport.properties). If the report engine cannot find the file, it uses the default mapping323