Visualize: Render Adhoc View
Test plugins
by juliia13
HTML
<script type='text/javascript' src="http://infra-platforms-phase2-5775-ysavoche.pfa.jaspersoft.com:8080/jasperserver-pro/client/visualize.js"></script>
<button id='export' onclick='exportReport()'>export</button>
<div id="container"></div>
JavaScript
visualize({
auth: {
name: "superuser",
password: "superuser"
}
}, function (v) {
var report = v.report({
resource: "/public/Yuliia/table_with_totals_Report",
container: "#container",
success: function(data) { console.log(data); },
error: function(e) { alert(e); }
});
exportReport = function () {
var _expOption = {
outputFormat: 'pdf'
};
report["export"](_expOption, function (link) {
window.location.href = link.href ? link.href : link;
}, function(e) { alert(e); });
};
});