iReport Ultimate Guide - Nimsoft Library

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

13.07.2015 Views

iReport Ultimate GuideFigure 5-24Date patternTo provide a convenient way to define string patterns, iReport provides a simple pattern editor. To open it, click the buttonlabeled “...” for the pattern property in the property sheet.5.4 Other Elements5.4.1 SubreportsThe Subreport element is used to include inside a report another report represented by an external Jasper file and feed using thesame database connection used by the parent report or thought a data source that is specified in the subreport properties.Figure 5-25Subreport element90

Report ElementsThe following briefly describes the characteristics of subreports:Subreport ExpressionSubreport ExpressionClassUsing cacheConnection/DatasourceExpressionParameters MapExpressionSubreport parametersSubreport return valuesThis identifies the expression that will return a subreport expression class object atrun time. According to the return type, the expression is evaluated in order torecover a Jasper object to be used to produce the subreport. In case the expressionclass is set to java.lang.String, UR will look for a file followingthe same approach explained for the Image Expression of the Image element.This is the class type of the expression; there are several options, each of onesubtends to a different way to load the UR object used to fill thesubreport.This specifies whether to keep in memory the report object used to create thesubreport in order to avoid to reload it all the times it will be used inside the report.It is common that a subreport element placed, for instance, into the Detail band isprinted more than once (or once for each record in the main dataset). The cacheworks only if the subreport expression is of type String since that string is usedas key for the cache.This identifies the expression that will return at run time a JDBC connection or aJRDataSource used to fill in the subreport. Alternatively the user can choose toavoid to pass any data. This last option is possible and many times it is very useful,but requires some expedient in order to make the subreport to work. Since asubreport (like a common report) will return an empty document if no data areprovided, the subreport document should have the document property When NoData Type set to something like All Sections, No Detail.This optional expression can be used to produce at run time an object of typejava.util.Map. The map must be contain a set of coupled names/objects thatwill be passed to the subreport in order to set a value for its parameters. Nothingdisallows to use this expression in order to pass as parameters map to the subreporta map previously passed as parameter to the parent report.This table allows you to define some coupled names/expressions that are useful fordynamically set a value for the subreport parameters by using calculatedexpressions.This table allows you to define how to store in local variables values calculated orprocessed in the subreport (such as totals and record count).5.4.2 FrameA frame is an element that can contain other elements and optionally draw a border around them, as shown in Figure 5-26.Figure 5-26Frame element91

<strong>iReport</strong> <strong>Ultimate</strong> <strong>Guide</strong>Figure 5-24Date patternTo provide a convenient way to define string patterns, <strong>iReport</strong> provides a simple pattern editor. To open it, click the buttonlabeled “...” for the pattern property in the property sheet.5.4 Other Elements5.4.1 SubreportsThe Subreport element is used to include inside a report another report represented by an external Jasper file and feed using thesame database connection used by the parent report or thought a data source that is specified in the subreport properties.Figure 5-25Subreport element90

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

Saved successfully!

Ooh no, something went wrong!