Java Reference
In-Depth Information
Hyperlink Type Description
Elements Defining Hyperlink Target
Reference
Hyperlink points to an external
resource.
<hyperlinkReferenceExpression>
RemoteAnchor Hyperlink points to an anchor in
an external resource.
<hyperlinkAnchorExpression>
<hyperlinkReferenceExpression>
RemotePage
<hyperlinkPageExpression>
Hyperlink points to a page in an
external resource.
<hyperlinkReferenceExpression>
The <textField> , <chart> , or <image> containing the hyperlinkType attribute
must contain the corresponding element defining the hyperlink target as shown
in the table. The only one out of these elements we haven't discussed is the
<hyperlinkPageExpression> element. This element must contain a report
expression resolving into a numeric value corresponding to the page number where
the hyperlink will take us.
Bookmarks
PDF documents can have a tree-like 'table of contents' that allows easy navigation
between the document sections. This 'table of contents' is labeled Bookmarks in most
PDF viewers. JasperReports can generate bookmarks in reports exported to PDF
by setting the bookmarkLevel attribute of any <image> , <chart> , or <textField>
containing an <anchorExpression> sub-element. The following JRXML template
illustrates the use of the bookmarkLevel attribute to create bookmarks. It is a slightly
modified version of the second subdataset example from the previous section.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//
EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport name="BookmarkDemoReport" leftMargin="5"
rightMargin="5">
<subDataset name="Aircraft_Registrations">
<parameter name="StateParam" class="java.lang.String" />
<queryString>
<![CDATA[select
a.city, count(*) as aircraft_count
from aircraft a
where a.state=$P{StateParam}
and a.city like 'A%'
group by city]]>
</queryString>
Search WWH ::




Custom Search