tmcbroom Posted July 7, 2014 Share Posted July 7, 2014 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 More sharing options...
paul.edmondson Posted July 8, 2014 Share Posted July 8, 2014 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 More sharing options...
tmcbroom Posted July 8, 2014 Author Share Posted July 8, 2014 Worked like a charm! Thanks for your help. Link to comment Share on other sites More sharing options...
marianol Posted July 16, 2014 Share Posted July 16, 2014 If you want to check it out, here is a sample of that https://github.com/marianol/JasperEmbedSample/blob/master/context-ic.html Link to comment Share on other sites More sharing options...
honeybakliwal Posted September 15, 2014 Share Posted September 15, 2014 Can you please help me. I need to implement same but not able to get the next option to change the page Link to comment Share on other sites More sharing options...
tusar.busybird Posted July 23, 2015 Share Posted July 23, 2015 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now