iReport Ultimate Guide - Nimsoft Library

iReport Ultimate Guide - Nimsoft Library iReport Ultimate Guide - Nimsoft Library

13.07.2015 Views

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

<strong>iReport</strong> <strong>Ultimate</strong> <strong>Guide</strong>You 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\<strong>iReport</strong>-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 <strong>iReport</strong> 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

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

Saved successfully!

Ooh no, something went wrong!