iReport Ultimate Guide - Nimsoft Library
iReport Ultimate Guide - Nimsoft Library iReport Ultimate Guide - Nimsoft Library
iReport Ultimate GuideYou can embed UR components in a Java application.The JasperReports Professional license file,which activates the Professional features, must be placed in the root of a folder or JAR file that is in the embeddingapplication’s classpath. For example, if UR is embedded in a web application, the license file can beplaced in the application’s WEB-INF/classes folder.Also, you must set the following properties of the URL of your SWF (Flash) files:com.jaspersoft.jasperreports.fusion.maps.base.swf.urlcom.jaspersoft.jasperreports.fusion.charts.base.swf.urlcom.jaspersoft.jasperreports.fusion.widgets.base.swf.urlThe URL can be a directory or web location. Here is an example of each:file:///C:\Program Files\iReport-Professional-3.6.0\ireportpro\FusionMaps_Enterprise\Mapshttp://localhost/MapsFor more information about building and deploying UR, along with the Maps, Charts, and Widgets Procomponents, see the Release Notes file in your iReport Professional installation.13.6 Localizing a ComponentWhen a report is meant to be produced in several languages, certain issues should be kept in mind:• All strings that are defined as data in your elements should be localized, including titles, subtitles, labels, and text values.• Since all the data is provided using expressions, the standard $R{...} syntax or all the other methods provided byUR to load a resource bundle key in an expression, are the best way to provide localized data for the chart.• Since all the data is provided using expressions, the standard $R{...} syntax and the other methods provided byUR to load a resource bundle key in an expression are the best way to provide localized data for the charts.• The localized formats of numbers and dates must be set explicitly using the advanced properties of each element.Numbers and dates are not automatically formatted according to the report locale. For numbers, the relevant properties areformatNumber, decimalSeparator, thousandSeparator, and decimals. For dates, use the propertyoutputDateFormat. The only chart that takes dates as input is the Gantt chart.• For details about localizing map labels, see 13.2.5, “Localizing Maps,” on page 251.13.7 Component LimitationsThe UR Flash chart components are extremely configurable and powerful, however, they do not expose alladvanced functionality that is available in native Maps, Charts and Widgets Flash implementations. Limitations include:• In all Pro components, it’s not possible to define reusable styles or custom animations.• Maps Pro does not support redefining entity codes and names or defining custom markers on a map.• Charts Pro does not support vertical data separator lines in column charts.276
Lists, Tables, and BarcodesCHAPTER 14 LISTS, TABLES, AND BARCODESiReport supports two additional components: List and Barcode. The List component is supported in iReport 5.0.2 and laterversions. It is basically a kind of light subreport which does not require any external report. The Barcode component issupported by iReport 5.0.1 and later versions. It is used to print barcodes.This chapter has two sections:• Lists• Barcodes14.1 ListsWhile the name of the List component might lead you to think it is a simple array of items, the component is really quitepowerful. It is defined entirely within a report, and it allows the items of the list to be defined with several elements, includingtextfield, images, and graphic objects. It can be used to present a group of related values or to create a small table that does notrequire calculations. The data used to fill the list is acquired using a subdataset—the List component cannot extract data froma main dataset.14.1.1 Working with the List ComponentTo use the List component, drag a List element from the elements palette into any band of the report. When the element iscreated in the band, iReport automatically adds a subdataset to the report and links the subdataset with it. You can see the newsubdataset in the Report Inspector. The new subdataset is empty, so you have to define all the required fields and, if the Listelement will get data from a database or another source that requires a query, you need to define the query. See Chapter 15 tolearn how to configure it.To configure a list element, right-click the List element and select Edit List Datasource. The Dataset Run window will open(Figure 14-1); it is used to define how the List element will use the subdataset.277
- Page 225 and 226: ChartsFigure 12-3Chart selection wi
- Page 227 and 228: ChartsFigure 12-6Dataset configurat
- Page 229 and 230: settings). These four fields have t
- Page 231 and 232: ChartsFigure 12-10 Chart Theme Desi
- Page 233 and 234: ChartsFigure 12-12 Example chart th
- Page 235 and 236: Run your report. iReport should dis
- Page 237 and 238: Charts1. First create a report.Figu
- Page 239 and 240: Charts4. Right-click on the chart a
- Page 241 and 242: Flash ChartsCHAPTER 13 FLASH CHARTS
- Page 243 and 244: Flash ChartsThe layout properties f
- Page 245 and 246: Flash ChartsThe following figure sh
- Page 247 and 248: Flash ChartsTable 13-2Entity IDs of
- Page 249 and 250: Flash ChartsTable 13-3Entity expres
- Page 251 and 252: Flash ChartsFigure 13-10 Specifying
- Page 253 and 254: Flash ChartsFigure 13-12 Bar chart
- Page 255 and 256: Flash ChartsFigure 13-16 The Charts
- Page 257 and 258: Flash ChartsFigure 13-19 Advanced o
- Page 259 and 260: Flash ChartsFigure 13-22 Entering t
- Page 261 and 262: Flash ChartsFigure 13-24 Specifying
- Page 263 and 264: Flash ChartsSpark LineSpark ColumnS
- Page 265 and 266: Flash ChartsFigure 13-32 Common opt
- Page 267 and 268: Flash ChartsFigure 13-35 Output of
- Page 269 and 270: Flash ChartsFigure 13-39 Output of
- Page 271 and 272: Flash ChartsFigure 13-43 Example of
- Page 273 and 274: Flash ChartsFigure 13-46 Specifying
- Page 275: Flash ChartsFigure 13-49 Specifying
- 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 and 324: InternationalizationCHAPTER 17 INTE
- Page 325 and 326: InternationalizationFigure 17-2Crea
Lists, Tables, and BarcodesCHAPTER 14 LISTS, TABLES, AND BARCODES<strong>iReport</strong> supports two additional components: List and Barcode. The List component is supported in <strong>iReport</strong> 5.0.2 and laterversions. It is basically a kind of light subreport which does not require any external report. The Barcode component issupported by <strong>iReport</strong> 5.0.1 and later versions. It is used to print barcodes.This chapter has two sections:• Lists• Barcodes14.1 ListsWhile the name of the List component might lead you to think it is a simple array of items, the component is really quitepowerful. It is defined entirely within a report, and it allows the items of the list to be defined with several elements, includingtextfield, images, and graphic objects. It can be used to present a group of related values or to create a small table that does notrequire calculations. The data used to fill the list is acquired using a subdataset—the List component cannot extract data froma main dataset.14.1.1 Working with the List ComponentTo use the List component, drag a List element from the elements palette into any band of the report. When the element iscreated in the band, <strong>iReport</strong> automatically adds a subdataset to the report and links the subdataset with it. You can see the newsubdataset in the Report Inspector. The new subdataset is empty, so you have to define all the required fields and, if the Listelement will get data from a database or another source that requires a query, you need to define the query. See Chapter 15 tolearn how to configure it.To configure a list element, right-click the List element and select Edit List Datasource. The Dataset Run window will open(Figure 14-1); it is used to define how the List element will use the subdataset.277