How to use JasperServer URL in the report?

0

Hi guys,

I need to export report data, but cannot use Dashboard or report built in functionality. I am using API call to export the report, a button with Reference hyperlink with something like this:

http://myJasperServer1.com/jasperserver-pro/rest_v2/reports/System_Repor...

The hyperlink works fine,  and I get the output when pressing the button.

The problem is that I need to deploy this report on multiple servers, so the URL must dynamically change to the correct one.
I tried to use a parameter to see if I can get the URL like this: 

$P{JASPER_REPORT}.getProperty("ireport.jasperserver.url")    -It worked and I get 'http://myJasperServer1.com/jasperserver-pro/' as parameter value on the original server.

However when I import the report into another server, I still see the original value of the parameter:  'http://myJasperServer1.com/jasperserver-pro/', even though the URL of the current server is different.

Perhaps I am doing this wrong? Or is there a better way to do this?

I would appreciate any help or advice. 

 


 

mariats's picture
Joined: Mar 12 2021 - 8:59pm
Last seen: 3 weeks 17 hours ago

1 Answer:

0

That's because the property "ireport.jasperserver.url" is something set by iReport when you publish the report using it.

If you just import the report in other servers, you are uploading the original property set before. You can change it in the jrxml. Or you can use iReport again to make the upload. making sure to overwrite after the porperty change.

If you are asking if there is an automatic way to retrieve the porperty without setting it first, I don't know.

gustavofarias's picture
Joined: May 22 2012 - 7:10am
Last seen: 42 min 31 sec ago
Feedback
randomness