Jedox reports can be embedded in external web applications. It is also possible for the external web application to set values for @variables in the Jedox report.
URL with passing variables
To find the URL of a report on a server, right-click on a report (user preview), select Properties, and open the Link tab. If this report has the variables “year”, “region”, and “product”, and all of them are not private, then you can pass variables with the URL as follows:
Calling commands from external sources using postMessage API
Note: for security reasons, restrict the postMessage to be accepted only from specific, trusted environments.
Before the postMessage API can be used, it must be enabled in Jedox Web Settings, as described in the steps below:
- Go to Jedox Web > Administration > Settings and click Add key. Fill in the fields as shown below (description is optional) and click OK:
- Add another key and fill in as shown below, using your own URI(s) in the Value field:
Click OK. PostMessage API is now enabled on the Jedox host. The Administration area shows the two new keys:
Example postMessage script
In this example, there are two hosts. Host A (https://from.mydomain.com) runs a web application that will post the message. Host B (https://to.mydomain.com) runs Jedox. The postMessage API has been enabled on Host B (Jedox) as described in the steps above.
The sample script below, running on a page on
https://from.mydomain.com, would set the value of the session variable
2018 inside the Jedox report served from
https://to.mydomain.com. In other words, it would send a postMessage to an element with the ID “jedox”:
<iframe id="jedox" width="80%" height="80%" src="https://to.mydomain.com/ui/lnk/?_=eJxNkD9vg0AMxb8K8oxg6cScpZUitcrKc...">
document.getElementById('jedox').contentWindow.postMessage( [ ['svar', 'Year', 2018] ], 'https://from.mydomain.com');
For more information on web messaging APIs, see https://en.wikipedia.org/wiki/Web_Messaging.