Basic Report Embed
Simple initialization of the library, plain text authentication and loading a report
by tara5
HTML
<script src="http://localhost:8080/jasperserver-pro/client/visualize.js"></script>
<div id="container"></div>
CSS
#container {
width:400px;
}
JavaScript
visualize({
auth: {
name: "superuser",
password: "superuser"
}
}, function (v) {
//render report from provided resource
v("#container").report({
resource: "/public/Samples/Reports/AllAccounts",
error: handleError
});
//show error
function handleError(err) {
alert(err.message);
}
});