Jump to content
We've recently updated our Privacy Statement, available here ×
  • REST API - export specif number of pages


    jzhou_1

    Requirement:

    The customer would like to know how to export specif number of pages via REST API. It can be embedded in the client application to retrieve the specific report pages according to the user seclection.


    Solution:

    Here are the steps you should follow to export specif number of pages. I'm using sample AllAccounts report logged in as superuser.

    1. Generate report in HTML and find out how many pages does it consist of:

      POST http://localhost:8080/jasperserver-pro-51/rest_v2/reportExecutions
      <reportExecutionRequest>
        <reportUnitUri>/organizations/organization_1/reports/samples/AllAccounts</reportUnitUri>
        <async>false</async>
        <interactive>true</interactive>
        <outputFormat>html</outputFormat>
        <ignorePagination>false</ignorePagination>
      </reportExecutionRequest>
    2. Download first ten pages of the report:

      GET http://localhost:8080/jasperserver-pro-51/rest_v2/reportExecutions/674823446_1378715298797_2/exports/html;pages=1-10/outputResource
      

      If you want to export another pages in next request just change URL accordingly (e.g. page 20):

      GET http://localhost:8080/jasperserver-pro-51/rest_v2/reportExecutions/674823446_1378715298797_2/exports/html;pages=20/outputResource
      

    User Feedback

    Recommended Comments

    I have the same requirement as posted in the original question, except I am using Jasper Server 7.5  Applying the GET command as given in the example, does not work.  Did the format of the command change in Jasper Server 7.5, and if so, please can you provide it?  (I have checked the REST API manual of Jasper Server, but it does not contain the solution).

    Link to comment
    Share on other sites



    Guest
    This is now closed for further comments

×
×
  • Create New...