james.perry Posted September 9, 2014 Share Posted September 9, 2014 I have a report that references a sub-report via URL. I need to be able to accomodate changes in how the report is hosted. (i.e. HTTP/HTTPS)Is there a way to determine the protocol that's being used to request a report?Perhaps a way to provide a relative path/URI? Link to comment Share on other sites More sharing options...
Solution james.perry Posted September 11, 2014 Author Solution Share Posted September 11, 2014 Create a parameter called something like PROTOCOL and drop this expression in it.$P{JASPER_REPORT}.getProperty("ireport.jasperserver.url" ).split( ":" )[0]This will give you either HTTP or HTTPS depending on how the user is accessing the platform.Then alter any hardcoded URLs to include $P{PROTOCOL}.e.g. <![CDATA[$P{PROTOCOL}://localhost:8080/blah/blah/blah]]' Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now