Visualize: scrollToTop option

by Pavel Savushchyk

HTML

<script type='text/javascript' src="http://build-master.jaspersoft.com:7980/jrs-pro-bugfix/client/visualize.js?_opt=false"></script>

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

<button id="next">go to page 2</button>

CSS

#container1 {
    background-color: #cccccc;
}

JavaScript

// http://build-master.jaspersoft.com:7980/jrs-pro-bugfix/client/visualize.js?_opt=false


// resize result in a way that there is a vertical scrollbar
// push "go to page 2" button
// scroll position shouldn't change

visualize({
    auth: {
        name: "superuser",
        password: "superuser"
    }
}, function (v) {

    var report = v.report({
        resource: "/public/Samples/Reports/AllAccounts",
        container: "#container",
        scrollToTop: false
    });
    
    
    jQuery("#next").click(function() {
        report.pages(2).run();
    });

});