Run report
post
/services/rest/v1/reports/{reportPath}/run
Sends a request to the Publisher to run a specific report.
The request is synchronized, and the response contains the report output.
Request
Supported Media Types
- multipart/form-data
Path Parameters
-
reportPath(required): string
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
-
ReportData: file
Report data. "Content-Type: application/octet-stream"
-
ReportRequest(required):
Report request. "Content-Type: application/json". Check the ReportRequest of Get report parameters (/services/rest/v1/reports/{reportPath}/parameters) for JSON structure.
Response
Supported Media Types
- multipart/form-data
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".
Nested Schema : ReportResponseMetaData
Type:
Show Source
object
-
metaDataList:
object MetaDataList
-
reportContentType:
string
The report content type. Possible values include: "text/html;charset=UTF-8""text/plain;charset=UTF-8" "application/pdf" "application/vnd.ms-powerpoint" "application/vnd.ms-excel" "application/msword" "application/x-shockwave-flash" "text/xml" "message/rfc822"
-
reportLocale:
string
The locale selected for the report (for example, fr_FR).
Nested Schema : MetaDataList
Type:
Show Source
object
-
metaDataName:
string
The name of the metadata.
-
metaDataValue:
string
The metadata content.
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 -i \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--request POST \
-F 'ReportRequest={"attributeFormat":"pdf",
"attributeTemplate":"Publisher Template"}' \
-o output.pdf \
'https://hostname/xmlpserver/services/rest/v1/reports/BalanceLetter'
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
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--
Run a report by passing parameter values
This example shows the request structure to pass the parameter values and run the report:
curl -i \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--request -o report_output.xml
-F 'ReportRequest={"attributeFormat":"xml",
"attributeTemplate":"Publisher Template",
"parameterNameValues":{"listOfParamNameValues":
{"item": [{"name": "dept","values": { "item": "10" }},
{"name": "emp","values": { "item": "*" }}]}}};
type=application/json'
'https://hostname/xmlpserver/services/rest/v1/reports/BalanceLetter/run'
This example represents the response:
POST xmlpserver/services/rest/v1/reports/sal/run HTTP/1.1 Accept: */* Content-Length: 393 Expect: 100-continue Content-Type:multipart/form-data; boundary=----------------------------70dcb3a85b79