Basic Dashboard Embed

Simple initialization of the library, plain text authentication and loading a dashboard

by Kishoreajey

HTML

<script type="text/javascript" src="http://jaspersoftdev.healthcareit.net/jasperserver-pro/client/visualize.js"></script>

<!-- JQuery - Latest compiled and minified -->
<script src="https://underscorejs.org/underscore.js"></script>
<script src="https://code.jquery.com/jquery-2.1.0.js"></script>

<div id="container">abc
</div>

JavaScript

visualize({
    auth: {
      name: "jasperadmin",
      password: "jasperadmin",
      organization:"organization_1"
    }
}, function (v) {

    //render report from provided resource
    v("#container").dashboard({
        resource: "/public/Samples/Reports/IHP_BI/Customer_VL_1/Customer_VL_Test",
        error: handleError
    });

    //show error
    function handleError(err) {
        alert(err.message);
    }
});