Jump to content
JasperReports Library 7.0 is now available ×

Multiple footnotes across multipage record?


dimitris.xypteras

Recommended Posts

Hi to All, this is my first post & my first go at Jasper Studio & Jasper Reports.

I have created a report with a multi-page text field (which includes text as well as data source fields), for which footnotes are required.
I am storing the page number of the referenced text as follows:
$P{REPORT_PARAMETERS_MAP}.put("footnote_x_page",$V{PAGE_NUMBER})
where 'x' is the number of each footnote.

At the footer of the page I have created text fields with the following expression:
$V{PAGE_NUMBER}.equals($P{REPORT_PARAMETERS_MAP}.get("footnote_x_page"))
Evaluation time is set to 'Now'.

This works fine if there is only one footnote; it is dynamically placed in the footer of the same page as the referenced text.
The problem is, if more footnotes are defined then they are all placed on the page of the first referenced text.

Any advice on how to do this properly would be much appreciated; thanks in advance!

Link to comment
Share on other sites

  • 1 year later...
  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 month later...

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0  -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="HyperlinkReport" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" isTitleNewPage="true" isSummaryNewPage="true" uuid="b6054a7a-8e08-4610-9655-bf6d1d8be6ec">
   <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
   <background>
       <band height="742"/>
   </background>
   <title>
       <band height="145">
           <frame>
               <reportElement mode="Opaque" x="0" y="0" width="555" height="145" backcolor="#FF99CC" uuid="639b254d-ca2e-4922-a66e-efd45e5613d7"/>
               <box>
                   <pen lineWidth="1.0"/>
               </box>
               <textField>
                   <reportElement x="6" y="331" width="450" height="20" uuid="dca53bee-7c10-45ad-8335-238e1f680d98"/>
                   <textElement>
                       <font size="14" isBold="true"/>
                   </textElement>
                   <textFieldExpression><![CDATA["This is the TITLE section"]]></textFieldExpression>
                   <anchorNameExpression><![CDATA["title"]]></anchorNameExpression>
               </textField>
               <textField hyperlinkType="LocalPage">
                   <reportElement x="5" y="65" width="300" height="15" forecolor="#008000" uuid="218ee333-139f-4d52-a444-4ea23f6265f7">
                       <propertyExpression name="net.sf.jasperreports.export.xls.sheet.name"><![CDATA["First Page"]]></propertyExpression>
                   </reportElement>
                   <textFieldExpression><![CDATA["  >> Click here to go to the second page."]]></textFieldExpression>
                   <hyperlinkPageExpression><![CDATA[2]]></hyperlinkPageExpression>
               </textField>
           </frame>
       </band>
   </title>
   <pageHeader>
       <band height="348">
           <frame>
               <reportElement mode="Opaque" x="0" y="0" width="555" height="145" backcolor="#CCFFCC" uuid="12ab7d69-93a1-416b-8939-013790160b96"/>
               <box>
                   <pen lineWidth="1.0"/>
               </box>
               <textField>
                   <reportElement x="5" y="5" width="450" height="20" uuid="47f4ca04-db59-40b0-ae24-677f4c60cadb"/>
                   <textElement>
                       <font size="14" isBold="true"/>
                   </textElement>
                   <textFieldExpression><![CDATA["This is the HEADER section of the page number " + String.valueOf($V{PAGE_NUMBER}) + "."]]></textFieldExpression>
                   <anchorNameExpression><![CDATA["pageHeader_" + String.valueOf($V{PAGE_NUMBER})]]></anchorNameExpression>
               </textField>
               <textField hyperlinkType="LocalAnchor">
                   <reportElement x="11" y="291" width="300" height="15" forecolor="#FF0000" uuid="ee65f99d-1daa-4f69-825a-33e9a74a1552"/>
                   <textFieldExpression><![CDATA["  >> Click here to go to the title section."]]></textFieldExpression>
                   <hyperlinkAnchorExpression><![CDATA["title"]]></hyperlinkAnchorExpression>
               </textField>
               <textField hyperlinkType="LocalAnchor">
                   <reportElement x="5" y="65" width="300" height="15" forecolor="#0000FF" uuid="7e334d20-accb-4aa7-b46c-803437440171"/>
                   <textFieldExpression><![CDATA["  >> Click here to go to the summary section."]]></textFieldExpression>
                   <hyperlinkAnchorExpression><![CDATA["summary"]]></hyperlinkAnchorExpression>
               </textField>
               <textField hyperlinkType="LocalAnchor">
                   <reportElement x="5" y="95" width="300" height="15" forecolor="#FFCC00" uuid="013dd321-4255-4bbc-9e0e-8a38e9c4fe58"/>
                   <textFieldExpression><![CDATA["  >> Click here to go to the footer of this page."]]></textFieldExpression>
                   <hyperlinkAnchorExpression><![CDATA["pageFooter_" + String.valueOf($V{PAGE_NUMBER})]]></hyperlinkAnchorExpression>
               </textField>
           </frame>
       </band>
   </pageHeader>
   <detail>
       <band height="288"/>
   </detail>
   <pageFooter>
       <band height="145">
           <frame>
               <reportElement mode="Opaque" x="0" y="0" width="555" height="145" backcolor="#FFFF99" uuid="c6a6e7c2-7b8e-4a37-89ae-c5eaf410cab1"/>
               <box>
                   <pen lineWidth="1.0"/>
               </box>
               <textField>
                   <reportElement x="5" y="5" width="450" height="20" uuid="5b0eb03a-343d-43af-b839-4c44069a9a46"/>
                   <textElement>
                       <font size="14" isBold="true"/>
                   </textElement>
                   <textFieldExpression><![CDATA["This is the FOOTER section of the page number " + String.valueOf($V{PAGE_NUMBER}) + "."]]></textFieldExpression>
                   <anchorNameExpression><![CDATA["pageFooter_" + String.valueOf($V{PAGE_NUMBER})]]></anchorNameExpression>
               </textField>
               <textField hyperlinkType="LocalAnchor">
                   <reportElement x="5" y="35" width="300" height="15" forecolor="#FF0000" uuid="34a84843-79a0-4ec9-91ab-a447197646ed"/>
                   <textFieldExpression><![CDATA["  >> Click here to go to the title section."]]></textFieldExpression>
                   <hyperlinkAnchorExpression><![CDATA["title"]]></hyperlinkAnchorExpression>
               </textField>
               <textField hyperlinkType="LocalAnchor">
                   <reportElement x="5" y="65" width="300" height="15" forecolor="#0000FF" uuid="6cae9978-0fc8-4026-a6ab-e936ff082060"/>
                   <textFieldExpression><![CDATA["  >> Click here to go to the summary section."]]></textFieldExpression>
                   <hyperlinkAnchorExpression><![CDATA["summary"]]></hyperlinkAnchorExpression>
               </textField>
               <textField hyperlinkType="LocalAnchor">
                   <reportElement x="5" y="95" width="300" height="15" forecolor="#008000" uuid="507d95ba-97ae-454d-a63e-fcb161ebf14c"/>
                   <textFieldExpression><![CDATA["  >> Click here to go to the header of this page."]]></textFieldExpression>
                   <hyperlinkAnchorExpression><![CDATA["pageHeader_" + String.valueOf($V{PAGE_NUMBER})]]></hyperlinkAnchorExpression>
               </textField>
           </frame>
       </band>
   </pageFooter>
   <summary>
       <band height="145">
           <frame>
               <reportElement mode="Opaque" x="0" y="0" width="555" height="145" backcolor="#99CCFF" uuid="071ee33d-fa6d-43e5-9461-0cf1c6af0930"/>
               <box>
                   <pen lineWidth="1.0"/>
               </box>
               <textField>
                   <reportElement x="5" y="5" width="450" height="20" uuid="c742532b-29e7-43bf-8f21-58de7530f389"/>
                   <textElement>
                       <font size="14" isBold="true"/>
                   </textElement>
                   <textFieldExpression><![CDATA["This is the SUMMARY section"]]></textFieldExpression>
                   <anchorNameExpression><![CDATA["summary"]]></anchorNameExpression>
               </textField>
               <textField hyperlinkType="LocalAnchor">
                   <reportElement x="5" y="35" width="300" height="15" forecolor="#FF0000" uuid="9902acc3-e821-4e4d-9c94-03b442681010">
                       <propertyExpression name="net.sf.jasperreports.export.xls.sheet.name"><![CDATA["Third Page"]]></propertyExpression>
                   </reportElement>
                   <textFieldExpression><![CDATA["  >> Click here to go to the title section."]]></textFieldExpression>
                   <hyperlinkAnchorExpression><![CDATA["title"]]></hyperlinkAnchorExpression>
               </textField>
               <textField hyperlinkType="LocalPage">
                   <reportElement x="5" y="65" width="300" height="15" forecolor="#008000" uuid="06bddced-f753-4135-a18b-9cc2caae3db3"/>
                   <textFieldExpression><![CDATA["  >> Click here to go to the second page."]]></textFieldExpression>
                   <hyperlinkPageExpression><![CDATA[2]]></hyperlinkPageExpression>
               </textField>
               <textField hyperlinkType="Reference">
                   <reportElement x="5" y="95" width="300" height="15" uuid="8d6e4b25-61c5-4888-a2dd-66fc0d2d16ed"/>
                   <textFieldExpression><![CDATA["  >> Click here to go to www.google.com"]]></textFieldExpression>
                   <hyperlinkReferenceExpression><![CDATA["http://www.google.com"]]></hyperlinkReferenceExpression>
               </textField>
           </frame>
       </band>
   </summary>
</jasperReport>

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...