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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>iReport</strong> <strong>Ultimate</strong> <strong>Guide</strong>6.1 Working with FieldsA print is commonly created starting from a data source that provides a set of records composed of a series of fields. Thisbehavior is exactly like obtaining the results of an SQL query.<strong>iReport</strong> displays available fields as children of the Fields node in the document outline view. To create a field, right-click theFields node and select the Add Field menu item. The new field will be included as an undefined child node in the ReportInspector, from which you can configure the field properties by selecting it and using the property sheet (Figure 6-2).Figure 6-2Field Properties dialogA field is identified by a unique name, a type, and an optional description. Additionally, you can define a set of name/valuepair properties for each field. These custom properties are not used directly by UR, but they can be used by externalapplications or by some custom modules of UR (such as a special query executor). You can set the customproperties with the Properties Editor (Figure 6-2), which you can open by clicking on the Editor button “...” in the column tothe right in the outline view.Figure 6-3Field - Custom PropertiesBefore the introduction of custom properties, <strong>iReport</strong> included additional information regarding the selected field in itsdescription field. An example of this would be the definition of fields to be used with an XML data source (that is, a datasource based on an XML file), where the field name can be arbitrary while the description holds an Xpath expression to locatethe value within the XML document.<strong>iReport</strong> determines the value for a field based on the data source you are using. For instance, when using an SQL query to filla report, <strong>iReport</strong> assumes that the name of the field is the same as the name of a field in the query result set. You must ensurethat the field name and type match the field name and type in the data source. We will see, though, how you can systematicallydeclare and configure large numbers of fields using the tools provided by <strong>iReport</strong>. Since the number of fields in a report can bequite large (possibly reaching the hundreds), <strong>iReport</strong> provides different tools for handling declaration fields retrieved fromparticular types of data sources.96

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

Saved successfully!

Ooh no, something went wrong!