Jump to content
Changes to the Jaspersoft community edition download ×

Show Number Of Pages Of Paginated Report


Recommended Posts

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? 

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

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 

e.g.
 
var rerport = v.report({
            resource: 'public/reports/myreportURI',
            container:'#container',
            events: {
                reportCompleted: function(status) {
                    console.log('Visualize:Report Completed');
                },
                changeTotalPages: function(totalPages) {
 
                    console.log(totalPages);
 
                },
                pageFinal: function(el) {
 
                },
                beforeRender: function(el) {
 
                }
            }
 
        });
 
 
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 10 months later...

From the above URL given by marianol:

var report = v.report({
        resource: reportUrl,
        container: "#jasperReportsContainer",
        success : function() {
               //report is rendered
        }
});
 
report.events({
        changeTotalPages: function(totalPages) {
            $('#totalPages').html(totalPages); //here you get the totalPages in report
        }
});
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...