how to go next page of report using virtualize.js

0

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

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

3 Answers:

0

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
4427
Joined: Sep 13 2011 - 8:04am
Last seen: 9 months 2 weeks ago
2

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: 3 years 1 month ago
0

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: 3 years 5 months ago
Feedback
randomness