Show Number Of Pages Of Paginated Report

Hi, I'm using visualize.js to display paginated reports.  I have the "Previous" and "Next" controls working, but I was curious if there was a way to display the number of pages and/or the number of results in the table.  For example, it could display "Page 1 of 8".  Or if you wanted t display the number of results, it could say "Showing 1 to 25 of 128 results".

Any ideas? 

tmcbroom's picture
Joined: Jul 7 2014 - 7:15am
Last seen: 8 years 3 months ago

Use the 'changeTotalPages' event to capture the number of pages int the report. The event will fire only when the number of pages in the report changes.  This is what I am using.  See the programming guide 

var rerport ={
            resource: 'public/reports/myreportURI',
            events: {
                reportCompleted: function(status) {
                    console.log('Visualize:Report Completed');
                changeTotalPages: function(totalPages) {
                pageFinal: function(el) {
                beforeRender: function(el) {
paul.edmondson - 8 years 4 months ago

Worked like a charm!  Thanks for your help.

tmcbroom - 8 years 4 months ago

Can you please help me. I need to implement same but not able to get the next option to change the page

honeybakliwal - 8 years 2 months ago

2 Answers:

If you want to check it out, here is a sample of that

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

From the above URL given by marianol:

var report ={
        resource: reportUrl,
        container: "#jasperReportsContainer",
        success : function() {
               //report is rendered
        changeTotalPages: function(totalPages) {
            $('#totalPages').html(totalPages); //here you get the totalPages in report
tusar.busybird's picture
Joined: Jul 23 2015 - 2:55am
Last seen: 6 years 9 months ago