Hyperlink in jasper reports across subreport

Hyperlink in jasper reports across subreport

how to set hyperlink in jasper report
jaspersoft studio hyperlink to another report

I want to add hyperlinks to my report. The hyperlink set in one report should take me to another subreport. Could you please tell me if this is feasible. If it is could you please provide step by step approach to achieve this?


First, yes, it is feasible.

Second, here are your step-by-step instructions:

  1. Right click on element you want to link from and select Hyperlink.
  2. Choose Hyperlink target: Blank
  3. Choose Hyperlink type: Reference
  4. In the reference tab, type the url to invoke the subreport (with parameters). For example, in one of my reports I call the ReportController servlet to create the subreport, like so: "./ReportController?reportName=ValidationDetailsChart&reportTitle=Validation%20Details&nParms=3&parmName_1=ORD_NUMBER&parmValue_1=" + $F{ORDER_NUMBER} + "&parmName_2=START_TIME_MS&parmValue_2=&parmName_3=END_TIME_MS&parmValue_3="
  5. Add a tooltip in the Tooltip tab (optional). Note you can reference variable and paramter values in the tooltip.

Note that there are other ways to do this, and your method may vary if you aren't using java and servlets to generate your reports. I would recommend looking at the ireport documentation for further instructions.

Hot to create a hyperlink to a subreport?, in subreports; values While a hyperlink usually opens a specific URL, JasperReports broadens the concept, extending it to a more complex Tooltip Expression – String to use as a tooltip when a user hovers the cursor over the hyperlink. The hyperlink type ReportExecution is one of these custom hyperlink extensions. It is used to execute a JasperReports Server report from another JasperReports Server report. This hyperlink type requires that the parameter _report is defined and points to the JasperReports Server report to execute. If this destination report contains one or more input controls, their value can be set by specifying the name of the input control as the parameter name and providing a value.


I got the solution to my problem. I had no requirement where I had to to pass any value from one subreport to another. So I simply right clicked on the textfield that I wanted the link on. I set the Hyperlink target as "Self" and Hyperlink type as "LocalPage" and in Hyperlink Page expression I set the following expression : Integer.valueOf(i) ,where i is page number(in my case it was sheet number) where I want the hyperlink to take me. If you want you can also use the following property : Integer.valueOf($V{REPORT_COUNT}).

Thanks everyone for the response.

Anchors, Bookmarks, and Hyperlinks, I am new to Jasper Reports. I have a requirement to open a sub report on click of a link in master report. I am able to provide link to google.co.in page but I am not able to provide hyperlink to sub report. hyperlinks of type "ReportExecution" allow you to link reports and achieve drill-down/drill-through. Save the report and, if you like, you can run it to see the result. Creation of the Second Subreport. The procedure to create the second subreport it is almost identical to the first one. Start a new report from File > New > Jasper Report. Choose Blank A4 for the template, save it in the same directory as the master, and call it PhoneReport


For navigation within reports I have implemented using Hyperlinks and Anchors

Below is the text field with hyperlinkAnchorExpression, this will be the link. Note the hyperlinkType="LocalAnchor"

<textField isStretchWithOverflow="true" hyperlinkType="LocalAnchor">
            <reportElement positionType="Float" stretchType="RelativeToTallestObject" x="80" y="0" width="80" height="20" forecolor="#3286C7" uuid="9a8313d2-21f3-4cd2-8e40-f9cddeb3cdaf"/>
            <box topPadding="3" leftPadding="3">
                <topPen lineWidth="0.2"/>
                <leftPen lineWidth="0.2"/>
                <bottomPen lineWidth="0.2"/>
                <rightPen lineWidth="0.2"/>
            </box>
            <textElement>
                <font isUnderline="true"/>
            </textElement>
            <textFieldExpression><![CDATA[$F{cAddress}.getId()]]></textFieldExpression>
            <hyperlinkAnchorExpression><![CDATA[$F{cAddress}.getId().toString()]]></hyperlinkAnchorExpression>
        </textField>

Below is the anchornameexpression, this will be called when a hyperlink is clicked and values is matched with the hyperlinkAnchorExpression value anywhere in the report.

</textField>
        <textField isStretchWithOverflow="true">
            <reportElement positionType="Float" stretchType="RelativeToTallestObject" x="80" y="0" width="80" height="20" uuid="9a8313d2-21f3-4cd2-8e40-f9cddeb3cdaf"/>
            <box topPadding="3" leftPadding="3">
                <topPen lineWidth="0.2"/>
                <leftPen lineWidth="0.2"/>
                <bottomPen lineWidth="0.2"/>
                <rightPen lineWidth="0.2"/>
            </box>
            <textFieldExpression><![CDATA[$F{id}]]></textFieldExpression>
            <anchorNameExpression><![CDATA[$F{id}.toString()]]></anchorNameExpression>
        </textField>

I have implemented this to navigate across reports and subreports. Hope this will be helpful.

How to provide HyperLink on click of which sub report should be , The following properties must be set to link the subreport to the parent report: you can pass the data source that will feed the subreport through a parameter,  I have a very simple working report, see attachment. It is based on the Sample database provided with iReport and JasperReports Server. What I want: I want to have a hyperlink to a text field element in the same report. In the sample report provided, click on the "Link to summary" and one should jump to the Summary text field. In iReport this works fine in the Internal Preview, in PDF, in HTML


Understanding Subreports, There are no special report elements that introduce hyperlinks or anchors in a The ToolTip expression will be evaluated along with the hyperlink and the result​  The subreport element lets you nest one report (the subreport) inside another (the master report). A subreport can use the same database connection as the parent report or you can specify a different data source in the subreport properties. A master report can contain multiple subreports and subreports can be nested. Subreports are one of the most advanced features of JasperReports. They allow


JasperReports 6.12.2, Create an Input Control that matches every parameter you expect to be passed to the subreport through the hyperlink. Parent Report. Right click  Creating a Link Between Reports on a JasperReports Server Instance. Hyperlinks of type ReportExecution execute one JasperReports Server report from another JasperReports Server report, for example, when drilling down to a report in the context of JasperReports Server. Instead of a hyperlink reference or similar expression, ReportExecution hyperlinks use JasperReports parameters to specify the target.


Jasper Report Server - Hyperlinks to Subreports!, Drill down Reports using Hyperlinks in Jasper/Ireports For simplicity let's call the Summary report as 'Main report' and Detailed report as 'Subreport'. You can follow any responses to this entry through the RSS 2.0 feed. Now, I want to pass the main REPORT_DATA_SOURCE to the subreport. How can I do this? As far as I know the REPORT_DATA_SOURCE is a consumable object, so it can only be used once, right?. Can I copy this data source and pass it? BTW: I use iReport for creating the layout.