Jump to content
Changes to the Jaspersoft community edition download ×

Link to different locations depending on environment


Recommended Posts


I'm trying to create a hyperlink that takes me to a different link depending on which server my report is running on and was wondering if someone could help.

The scenario:

  • We have a development server and a live server.
  • I want a link in the report to go to a corresponding link in the development environment if that's where the report is running.
  • If the report is running in the live environment then I want the link to go somewhere else.
  • The link is not another jaspersoft report, it's a spring web application, so I can't use the report execution hyperlink option.
  • I don't want to have to make any changes to the report between the 2 environments, just a straight export.

Both enviroments use different databases so I've tried doing it this way:

$P{REPORT_CONNECTION}.getMetaData().getURL().contains("live-db") ? "http://livelink.com" : "http://devlink.com"[/code]


This approach works for my browser but doesn't seem to work for another persons browser (always taking them to the dev link). I haven't fully investigated why.

Does anyone know of a better way to do achieve this?



Jasperserver Pro 4.7

iReport 4.7




Link to comment
Share on other sites

  • 1 month later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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