How to use a server attribute (ServerAttribute_env_url) in json data adapter's url element

1. I created a server attribute with name 'env_url' and value ="http://......."

2. I want to use this in the JSON data adapter.

Is it possible to pass a server attribute like below to a JSON data adapter ?

<?xml version="1.0" encoding="UTF-8" ?>
<jsonDataAdapter class=""><name>smc-per-calendar-json-adapter_2</name>
<dataFile xmlns:xsi="" xsi:type="httpDataLocation">



I get :

net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Error opening input stream from URL: repo:/reports/dataadapter/myJsonDataAdapter.xml.
    at net.sf.jasperreports.repo.DefaultRepositoryService.getInputStream(
    at net.sf.jasperreports.repo.InputStreamPersistenceService.load(
    at net.sf.jasperreports.repo.DefaultRepositoryService.getResource(






The data source url changes per environment (dev, qa, prod), so I would like it dynamically set. I am trying achieve it with server attributes (I may have a jasper server instance running per environment). Any other suggestions are appreciated. 

kothany's picture
Joined: Nov 16 2018 - 1:46pm
Last seen: 8 months 3 days ago
narcism - 4 years 1 month ago

Thank you narcism. Its working, the link you provided has solved my problem. 

kothany - 4 years 1 month ago

0 Answers:

No answers yet