Basic Dashboard Embed
Simple initialization of the library, plain text authentication and loading a dashboard
by Pavel Savushchyk
HTML
<script src="http://build-master.jaspersoft.com:5980/jrs-pro-trunk/client/visualize.js?_opt=false"></script>
<div id="container" height="500px"></div>
CSS
#container {
width: 1000px;
}
JavaScript
visualize({
auth: {
name: "joeuser",
password: "joeuser",
organization: "organization_1"
}
}, function (v) {
//render report from provided resource
v("#container").dashboard({
resource: "/public/Samples/Dashboards/1._Supermart_Dashboard",
error: handleError
});
//show error
function handleError(err) {
alert(err.message);
}
});