iReport Ultimate Guide - Nimsoft Library

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

13.07.2015 Views

iReport Ultimate Guide5.6.1 Hyperlink TypeUR provides five types of built-in hypertext links: Reference, LocalAnchor, LocalPage, RemoteAnchor andRemotePage. Anyway, other types can be implemented and plugged into UR (like the type ReportExecutionused by UR to implement the drill down features). Here is a list of the link types:ReferenceLocalAnchorLocalPageRemoteAnchorRemotePageThe Reference link indicates an external source that is identified by a normal URL.This is ideal to point, for example, to a servility to manage a record drill-down tools.The only expression required is the hyperlink reference expression.To point to a local anchor means to create a link between two locations into thesame document. It can be used, for example, to link the titles of a summary to thechapters to which they refer.To define the local anchor, it is necessary to specify a hyperlink anchor expression,which will have to produce a valid anchor name.If instead of pointing to an anchor you want to point to a specific current reportpage, you need to create a LocalPage link. In this case, it is necessary to specifythe page number you are pointing to by means of a hyperlink page expression (theexpression has to return an Integer object).If you want to point to a particular anchor that resides in an external document, youuse the RemoteAnchor link. In this case, the URL of the external file pointed to willhave to be specified in the Hyperlink Reference Expression field, and the name ofthe anchor will have to be specified in the Hyperlink Anchor Expression field.This link allows you to point to a particular page of an external document. Similarly,in this case the URL of the external file pointed to will have to be specified in theHyperlink Reference Expression field, and the page number will have to bespecified by means of the hyperlink page expression.Some export formats have no support for hypertext links.5.6.2 Hyperlink ParametersSometimes you will need to define some parameters that must be “attached” to the link. The Link parameters table provides aconvenient way to define them. The parameter value can be set using an expression. The parameter expression is supposed tobe a string (since it will be encoded in the URL). But when using custom link types it makes sense to set different types forparameters.5.6.3 Hyperlink TooltipThe tooltip expression is used to set a text to display as tooltip when the mouse is over the element that represents thehyperlink (this only works when the document is exported in a format that supports this type of interactive use).94

Fields, Parameters, and VariablesCHAPTER 6FIELDS, PARAMETERS, AND VARIABLESIn a report, there are three groups of objects that can store values:• Fields• Parameters• VariablesiReport uses these objects in data source queries. In order to use these objects in a report, they must be declared with a discretetype that corresponds to a Java class, such as String or Double. After they have been declared in a report design, the objectscan be modified or updated during the report generation process.Figure 6-1Report objects in outline viewAfter they have been declared, they can be managed using the Report Inspector view. In the Report Inspector you can modifyor remove objects and declare new objects, as well.This chapter has the following sections:• Working with Fields• Working with Parameters• Working with Variables• Evaluating Elements During Report Generation95

<strong>iReport</strong> <strong>Ultimate</strong> <strong>Guide</strong>5.6.1 Hyperlink TypeUR provides five types of built-in hypertext links: Reference, LocalAnchor, LocalPage, RemoteAnchor andRemotePage. Anyway, other types can be implemented and plugged into UR (like the type ReportExecutionused by UR to implement the drill down features). Here is a list of the link types:ReferenceLocalAnchorLocalPageRemoteAnchorRemotePageThe Reference link indicates an external source that is identified by a normal URL.This is ideal to point, for example, to a servility to manage a record drill-down tools.The only expression required is the hyperlink reference expression.To point to a local anchor means to create a link between two locations into thesame document. It can be used, for example, to link the titles of a summary to thechapters to which they refer.To define the local anchor, it is necessary to specify a hyperlink anchor expression,which will have to produce a valid anchor name.If instead of pointing to an anchor you want to point to a specific current reportpage, you need to create a LocalPage link. In this case, it is necessary to specifythe page number you are pointing to by means of a hyperlink page expression (theexpression has to return an Integer object).If you want to point to a particular anchor that resides in an external document, youuse the RemoteAnchor link. In this case, the URL of the external file pointed to willhave to be specified in the Hyperlink Reference Expression field, and the name ofthe anchor will have to be specified in the Hyperlink Anchor Expression field.This link allows you to point to a particular page of an external document. Similarly,in this case the URL of the external file pointed to will have to be specified in theHyperlink Reference Expression field, and the page number will have to bespecified by means of the hyperlink page expression.Some export formats have no support for hypertext links.5.6.2 Hyperlink ParametersSometimes you will need to define some parameters that must be “attached” to the link. The Link parameters table provides aconvenient way to define them. The parameter value can be set using an expression. The parameter expression is supposed tobe a string (since it will be encoded in the URL). But when using custom link types it makes sense to set different types forparameters.5.6.3 Hyperlink TooltipThe tooltip expression is used to set a text to display as tooltip when the mouse is over the element that represents thehyperlink (this only works when the document is exported in a format that supports this type of interactive use).94

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

Saved successfully!

Ooh no, something went wrong!