Jump to content

Recommended Posts

  • 2 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

Hi ReachMe, 
You can have a look at the document "TIBCO JASPERREPORTS® SERVER REST API REFERENCE".
Section "CHAPTER 13 THE reportExecutions SERVICE"
I think this is the only way, besides making use of visualise.js (js lib for enterprise jaspersoft)

Make a report request first via a POST 
Example :
https://localhost:8443/jasperserver/rest_v2/reportExecutions

Headers
X-REMOTE-DOMAIN : 1
Content-Type : application/json

Body 
{
  "reportUnitUri" : "path_to_report_on_server/myfirstreport",
  "outputFormat" : "html",
  "parameters" : {    
                    "option":[
                      {
                        "name":"myInputControl_1",
                        "value":["HelloValue"]
                      },
                      {    
                          "name":"myInputControl_2",
                          "value":["DAILY","WEEKLY","MONTHLY"]
                    }
                    ]
                }
}

If 200, you will received a xml response with a requestId in it. You will then make use of this requestid
<requestId>2f373725-5190-43a3-8ea4-a8fa96f52a05</requestId>

Then you need to do a GET request with the requestid
https://localhost:8443/jasperserver/rest_v2/reportExecutions/2f373725-5190-43a3-8ea4-a8fa96f52a05

if 200, you will receive a xml response, look into the <export> tag and look for the <id > 
<exports>
    <export>
         <attachments>…</attachments>
         <id>fdd2322d-2e48-4a63-a661-8155501a19fe</id>

You will required the id to do another GET reqeust. You need the requestid and the id above. 
https://localhost:8443/jasperserver/rest_v2/reportExecutions/2f373725-5190-43a3-8ea4-a8fa96f52a05/exports/fdd2322d-2e48-4a63-a661-8155501a19fe/outputResource

if 200, then you will get response with the report. So in this scenario a html  document

Hope this helps you out.
 

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...