derek_ricca Posted August 7, 2007 Share Posted August 7, 2007 Ok, I saw in another thread that there's a fairly simple way in Java to get the total number of pages (identified in a jasper report as $P{PAGE_COUNT}. My question is how do I export that number through a PHP/SOAP interface? I'm trying to make a scrollable interface (ie: "Page 1|2|3|4" or something). The PHP example doesn't really help at all in this instance. Thanks. Link to comment Share on other sites More sharing options...
takashi Posted August 7, 2007 Share Posted August 7, 2007 I know there is module that you can integrate Java into PHP, but I never used PHP. If you know how to do, integrate following Java code: //this is comment//jasperPrint is JasperPrint Object.int total_pages=jasperPrint.getPages().size(); Link to comment Share on other sites More sharing options...
derek_ricca Posted August 8, 2007 Author Share Posted August 8, 2007 Is that the only way to do it? Link to comment Share on other sites More sharing options...
derek_ricca Posted August 11, 2007 Author Share Posted August 11, 2007 Since nobody had any idea how to do this, I figured I would post up the solution I came up with. It's not perfect but it works. Maybe the writers of JasperReports can include it, it's pretty simple. Anyway, I simply created a Java class which extends the ManagementService class (part of the com.jaspersoft.jasperserver.ws.axis2 package), overwriting the "runReport" function with pretty much the same thing, except I add the following lines right before addAdditionalAttachmentsForReport(jasperPrint, attachments, format, new StringBuffer(new String(bos.toByteArray())));: Code:num_pages = jasperPrint.getPages().size();or.setMessage("Total pages: " + num_pages); This just returns the number of pages in the operation result. I think this should have definitely been a standard part of HTML export, since otherwise it's pretty much impossible to get the total number of pages unless it's through a JSP (which I'm not using and many other people don't use either), and kind of stupid to force the user to guess or check for an error every time they increment the page they're displaying. If anyone needs the class file just reply and I'll post it up. Post edited by: derek_ricca, at: 2007/08/10 19:16Post edited by: derek_ricca, at: 2007/08/10 19:18 Link to comment Share on other sites More sharing options...
lucianc Posted August 20, 2007 Share Posted August 20, 2007 Please post JasperServer any bugs and feature requests here so that we can properly track them. Regards,Lucian 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