Run report

post

/services/rest/v1/reports/{reportPath}/run

Sends a request to the Oracle BI Publisher server to run a specific report. The request is syncronized, and the response contains the report output.

Request

Supported Media Types
Path Parameters
  • URL encoded report path. For example, if your report path is "/Sample Lite/Published Reporting/Reports/Balance Letter" then your encoded report path will be "%2FSample%20Lite%2FPublished%20Reporting%2FReports%2FBalance%20Letter". Use double encoded forward slash when you send a REST request to BI Publisher through a load balancer that isn't configured to pass encoded slashes. For example, if your report path is "/Sample Lite/Published Reporting/Reports/Balance Letter" then your encoded report path will be Sample%20Lite%252FPublished%20Reporting%252FReports%252FBalance%20Letter
Form Parameters
  • Report data. "Content-Type: application/octet-stream"
  • Report request. "Content-Type: application/json". Check the ReportRequest of Get report parameters (/services/rest/v1/reports/{reportPath}/parameters) for JSON structure.
Back to Top

Response

Supported Media Types

200 Response

Returns the report output as multipart/form-data having two parts. 1) ReportResponse having "Content-Type: application/json". 2) ReportOutput having "Content-Type: application/octet-stream".
Body ()
Root Schema : ReportResponse
Type: object
Show Source
Nested Schema : ReportResponseMetaData
Type: object
Show Source
Nested Schema : MetaDataList
Type: object
Show Source
Back to Top

Examples

Simple run report request and response

The following example shows how to run a report by submitting a POST request on the REST resource using cURL.

curl -X POST -u username:password -o report_output.html -H
      "Content-Type:multipart/form-data"  -v -F
      'ReportRequest={"attributeFormat":"html","attributeTemplate":"Publisher
      Template"};type=application/json' 
http://host.com:port/xmlpserver/services/rest/v1/reports
/Sample%20Lite%252FPublished%20Reporting%252FReports%252FBalance%20Letter/run

After you run the CURL commad to run the report, the report_output.html output file contains the metadata JSON and the actual report output data. Remove the metadata section from the output file.

This example shows the request structure to run a simple report:

--Boundary_1_1153447573_1465550731355
Content-Type: application/json
Content-Disposition: form-data; name="ReportRequest"

{"byPassCache":true,"flattenXML":false}
--Boundary_1_1153447573_1465550731355--

This example represents the response:

--Boundary_4_543972006_1465550732053
Content-Type: application/json
Content-Disposition: form-data; name="ReportResponse"

{"reportContentType":"application/pdf"}
--Boundary_4_543972006_1465550732053
Content-Type: application/octet-stream
Content-Disposition: form-data; filename="xmlp3001677868600512506tmp"; 
modification-date="Fri, 10 Jun 2017 09:25:32 GMT"; size=7638; name="ReportOutput"

<Report output. For example PDF,HTML,EXCEL content>
--Boundary_4_543972006_1465550732053--

Run a report with custom report data

The following example shows how to run a report with custom report data by submitting a POST request on the REST resource using cURL. Run the cURL command from the directory where you have placed the mydata.xml file.

curl -X POST -v -u username:password 
-o report_output.html -H "Content-Type:multipart/form-data" 
-F 'ReportData=@mydata.xml;type=application/octet-stream' 
-F 'ReportRequest={"attributeFormat":"html",
"attributeTemplate":"Publisher Template","byPassCache":"true"};
type=application/json' 
http://host.com:port/xmlpserver/services/rest/v1/reports
/Sample%20Lite%252FPublished%20Reporting%252FReports%252FBalance%20Letter/run
This example shows the request structure to run a report with custom report data:
--Boundary_3_384617262_1465550732541
Content-Type: application/json
Content-Disposition: form-data; name="ReportRequest"

{"byPassCache":true,"flattenXML":false}
--Boundary_3_384617262_1465550732541
Content-Type: application/xml
Content-Disposition: form-data; filename="Balance Letter.xml"; 
modification-date="Tue, 01 Jan 2000 07:35:28 GMT"; size=24700; name="ReportData"

<Report XML Data Content>
--Boundary_3_384617262_1465550732541--

This example represents the response:

--Boundary_6_656616533_1465550732888
Content-Type: application/json
Content-Disposition: form-data; name="ReportResponse"

{"reportContentType":"application/pdf"}
--Boundary_6_656616533_1465550732888
Content-Type: application/octet-stream
Content-Disposition: form-data; filename="xmlp2661880851808387788tmp"; 
modification-date="Fri, 01 Jan 2000 09:25:32 GMT"; size=7647; name="ReportOutput"

<Report output. For example PDF,HTML,EXCEL content>
--Boundary_6_656616533_1465550732888--
Back to Top