Run report
/services/rest/v1/reports/{reportPath}/run
Request
- multipart/form-data
-
reportPath: 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
-
ReportData(optional): file
Report data. "Content-Type: application/octet-stream"
-
ReportRequest:
Report request. "Content-Type: application/json". Check the ReportRequest of Get report parameters (/services/rest/v1/reports/{reportPath}/parameters) for JSON structure.
Response
- multipart/form-data
200 Response
object
-
metaDataList(optional):
object MetaDataList
-
reportContentType(optional):
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(optional):
string
The locale selected for the report (for example, fr_FR).
object
-
metaDataName(optional):
string
The name of the metadata.
-
metaDataValue(optional):
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 -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/runThis 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--