Visualize: Report+controls
Test plugins
by Yuriy Bablyukh
HTML
<!--Provide URL to visualize.js-->
<script src="http://localhost:8080/jasperserver-pro/client/visualize.js?_opt=false"></script>
<!--Provide container to render your visualization-->
<table>
<tr valign="top">
<td style="width:80%">
<div id="container"></div>
</td>
<td style="width:20%">
<div id="inputContainer">
<button id="export">
Export
</button>
</div>
</td>
</tr>
</table>
JavaScript
visualize({
auth: {
name: "jasperadmin",
password: "jasperadmin",
organization: "organization_1"
}
}, function(v) {
var report = v.report({
resource: "/public/Samples/Reports/10g.PerformanceByStoreType",
container: "#container",
error: function(err) {
console.error(err);
}
});
report.report["export"]({
outputFormat: "json"
}, function (link) {
window.location.href = link.href ? link.href : link;
}, _viz.handleError);
});