z3n71n3l Posted October 15, 2009 Share Posted October 15, 2009 Hey Devs I would like to determine the amount of pages which my jasper report result returns. I successfully wrote a PHP xml service which access my jasper server’s services via a soap connection. I can view all my jasper reports on my website now. The 'BUT' is that some of reports take a long time to return a result. Thus I made used of the paging functionality build into the jasper XML services. So that the user only retrieves one page at a time. The problem that I have is that I cannot determine the total amount of pages that my report consists of and thus I cannot stop the user from paging outside the boundaries of the report. For example if the report consists of 100 pages, the user can page beyond 100. Code:<request operationName="runReport"> <argument name='RUN_OUTPUT_FORMAT'>HTML</argument> <argument name='PAGE'>10</argument> <argument name="USE_DIME_ATTACHMENTS"><![CDATA[1]]></argument> <resourceDescriptor name="" wsType="reportUnit" uriString="d(O_o)b" isNew="false"> <label></label> <parameter name="d(O_o)b"><![CDATA[2009/9/28]]></parameter> <parameter name="d(O_o)b"><![CDATA[2009/9/29]]></parameter> </resourceDescriptor> </request> Link to comment Share on other sites More sharing options...
swood Posted October 17, 2009 Share Posted October 17, 2009 As you know, you can get back a variety of output formats, including a Java object - a "JasperPrint" or JRPRINT in the web services call. This is the complete report and you can determine the number of pages from that. Of course, this will be some work to manage on the PHP end. The other output formats do not give a maximum number of pages. Could you get the complete report, store it on your server end and manage the pagination there? That would be faster than requesting a page at a time, as the report wil have to be rerun for each page. For large reports, it may be better to schedule a report and have JasperServer send it to the user via email, either as an attachment or as a link back to JasperServer. You can schedule reports via web services, running immediately "in the backgound" or at specific times. ShermanJaspersoft Link to comment Share on other sites More sharing options...
z3n71n3l Posted October 20, 2009 Author Share Posted October 20, 2009 Thanx 4 the reply. Sounds like alot of caffeine is going into this one if I choose to go that way. Post Edited by z3n71n3l at 10/20/2009 06:55 Link to comment Share on other sites More sharing options...
loneparadox Posted October 20, 2009 Share Posted October 20, 2009 Would it not be possible to have the number of pages returned in the xml response, when the report type is HTML and pagination is on. This is something that just makes sense, or at least I think so. Why have pagination support if you dont know the total number of pages for the report. I think this is very necessary. Can I log this as a feature request? Link to comment Share on other sites More sharing options...
swood Posted October 21, 2009 Share Posted October 21, 2009 Yep - log it as a request. ShermanJaspersoft Link to comment Share on other sites More sharing options...
loneparadox Posted October 21, 2009 Share Posted October 21, 2009 feature request is logged here:http://jasperforge.org/projects/jasperserver/tracker/view.php?id=4366 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