Jump to content
We've recently updated our Privacy Statement, available here ×

Hot to create a hyperlink to a subreport?


kfung

Recommended Posts

I'm pretty new to jasper reports and jasper server.  I'm creating a report within ireport and uploading the report on jasper server.  I've looked at the hyperlink sample but it does not show you how to use a hyperlink to another report.

I was wondering how do I use a hyperlink to create a drilldown to a subreport?

Link to comment
Share on other sites

  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

Hello,

I give you MY method. It is not perhaps the better one but it works.

In the properties of the field I want to use to drill-down, in the "hypertext link" tab, I select "Reference" as link type and I put :

"/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/Concerto/Test1&Param1=val1

&Param2=val2&....." "Test1" is the name of the report in the repository and "/reports/Concerto" is the "Uri" path. Of course "val1" etc... may be in relation with the field itself or other parameters.

Till now, this works. Perhaps  with the V3 there is another way morre efficient? I don't know.

Hope this will help you.

Link to comment
Share on other sites

  • 1 year later...
  • 3 weeks later...

Actually, hyperlinkType = "Reference" is complicated compared to hyperlinkType = "ReportExecution". See below for an example from the Employees sample report.

 

The <hyperlinkParameter name="_report"> is the URI of the destination report. Additional hyperlinkParameters refer to the input controls of the destination report.

 

Sherman

Jaspersoft

Code:
<textField isStretchWithOverflow="true" hyperlinkType="ReportExecution">	<reportElement x="410" y="4" width="105" height="16">		<property name="net.sf.jasperreports.export.pdf.tag.td" value="full"/>	</reportElement>	<textElement textAlignment="Center"/>	<textFieldExpression class="java.lang.String"><![CDATA["view"]]></textFieldExpression>	<hyperlinkParameter name="_report">		<hyperlinkParameterExpression><![CDATA["/reports/samples/EmployeeAccounts"]]></hyperlinkParameterExpression>	</hyperlinkParameter>	<hyperlinkParameter name="EmployeeID">		<hyperlinkParameterExpression><![CDATA[$F{id}]]></hyperlinkParameterExpression>	</hyperlinkParameter></textField>
Link to comment
Share on other sites

  • 8 months later...

Sherman,

Can you provide me with the equivalent steps in iReport? I tried creating a hyperlink by setting the hyperlink target to blank,
hyperlink type to "ReportExecution" and then creating the following Link parameters;
 

Parameter Name - Experession

_report = "reportsSpotlight"
Hcp_id = $F{Ext_Id}.toString

where Hcp_Id is the parameter of the report and $F{Ext_Id} is the value I wish to pass it. The report compiles fine but the link does not work in the ireport viewer or in the browser. When I upload the reports to the JasperServer I get the same results.
 

/uploads/projects/jasperserver/Capture.JPG

This method does work correctly. I was using the wrong value for the "_report" parameter. Also note that the hyplink will only work when the report is run from the JasperServer unless you change the "_report" parameter to point to a local file.

Post Edited by awoliver777 at 08/18/2010 15:07



Post Edited by awoliver777 at 10/06/2010 16:49
Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

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...