JSFiddle - React, Tailwind, and code Playground
by Kishoreajey
HTML
<!-- Visualize: login/logout with SSO sample
-->
<script type='text/javascript' src="https://code.jquery.com/jquery-2.1.0.js"></script>
Enter Server path: <input id="serverPath" style="width:420px;" value="https://jaspersoftdev.healthcareit.net/jasperserver-pro/client/visualize.js"/><BR><BR>
Enter Report path: <input id="reportPath" style="width:420px;" value="/public/Samples/Reports/IHP_BI/Theme_Test_Report"/><BR><BR>
<script type="text/javascript">
var JSLink = $("#serverPath").val();
var JSElement = document.createElement('script');
JSElement.src =JSLink;
document.getElementsByTagName('head')[0].appendChild(JSElement);
</script>
<button id="button">View Report</button>
<!--Provide container to render your visualization-->
<br><br>
<div id="container"></div>
JavaScript
// Plain text authentication with report rendering from a list
visualize({
auth: {
name: "jasperadmin",
password: "jasperadmin",
organization:"organization_1"
}
}, function (v){
function createReport(uri) {
v("#container").report({
resource: uri,
scale: "container",
error: function (err) {
alert(err.message);
}
});
};
createReport($("#reportPath").val());
$("#button").click(function () {
$("#container").html("");
createReport($("#reportPath").val());
});
}, function(err){
alert(err.message);
});