how to go next page of report using virtualize.js

how to show multiple pages of jasper report using virtulize.js 

h.aulakh89's picture
Joined: Nov 26 2014 - 8:40pm
Last seen: 1 year 10 months ago

3 Answers:

You need to use the report.pages() method. Here you have a sample http://jsfiddle.net/marianol/pu4dW/

A fiddle is worth 100000 words :)

marianol's picture
16388
Joined: Sep 13 2011 - 8:04am
Last seen: 4 years 8 months ago

Take a look at section 4.8 in the programming guide http://community.jaspersoft.com/documentation/v561-v560/jasperreports-server-programming-guide

 

visualize({
    auth: { ...
    }
}, function (v) {
        var report = v.report({
        resource: "/public/Samples/Reports/AllAccounts",
        container: "#container"
});
 
$("#previousPage").click(function() {
    var currentPage = report.pages() || 1;
    report
        .pages(--currentPage)
        .run()
        .fail(function(err) { alert(err); });
});
 
$("#nextPage").click(function() {
        var currentPage = report.pages() || 1;
        report
        .pages(++currentPage)
        .run()
        .fail(function(err) { alert(err); });
});
 
});
tyson.decker's picture
Joined: Nov 13 2014 - 2:27pm
Last seen: 7 years 2 weeks ago

I have a question related to pagination in visualize.

I have one report which is rendered using iframe and have top toolbar with pagination and export options (see jasper_iframe.png)

When I convert this report to visualize,js the top tollbar is gone (see jasper_visualize.png)

My question is does Visualize.js has native support of this toolbar or we have to implement it as you describe above? Any explaination would be really appreciated

atifoxon's picture
Joined: May 17 2015 - 6:03am
Last seen: 7 years 3 months ago
Feedback