Create report
/services/rest/v1/reports
Request
- multipart/form-data
-
ReportRequest:
Report metadata having "Content-Type: application/json". Check the examples section for JSON structure details.
-
TemplateData(optional): file
Template file. "Content-Type: application/octet-stream"
-
XliffData(optional): file
Translation file (XLIFF). "Content-Type: application/octet-stream"
Response
201 Response
400 Response
Examples
Simple create report request
The following example shows the request structure to create a report:
--Boundary_1_1153447573_1465550157807 Content-Type: application/json Content-Disposition: form-data; name="ReportRequest" {"absolutePath":"FolderName/SubFolderName/","dataModelPath":"/Sample Lite/Published Reporting/Data Models/Balance Letter Datamodel.xdm","name":"ReportName","update":false} --Boundary_1_1153447573_1465550157807--
Where:
-
name (string): Name of the report. Do not suffix it with .xdo. For example, specify name="myreport" (not name="myreport.xdo").
-
absolutePath (string): Path to the folder where you want to save the report. For example: xmlp/Reports/financials
-
dataModelPath (string): Path to the data model that will be used as the data source for this report. For example: xmlp/Reports/financials/Data Models/my data model.xdm
-
templateFileName(string): File name of the template to add the report definition.
-
xliffFileName (string): File name of the translation XLIFF file, appended with the locale as follows:
template_<language code>_<country code>.xlf
where:
-
language_code is the two-letter ISO 639 language code
-
country_code is the two-letter ISO 639 language code
For example: template_en_us.xlf
-
update (boolean): If true, overwrites the existing report. If false, throws an error if the report exists.
The following example shows how to create a report from an existing data model by submitting a POST request on the REST resource using cURL.
curl -X POST -u username:password -H "Content-Type:multipart/form-data" -F 'ReportRequest={"absolutePath":"FolderName/SubFolderName/", "dataModelPath":"/Sample Lite/Published Reporting/Data Models/Balance Letter Datamodel.xdm","name":"ReportName","update":false}; type=application/json' http://host.com:port/xmlpserver/services/rest/v1/reports
Create a report with a custom template
The following example shows how to create a report using a custom template by submitting a POST request on the REST resource using cURL.
Make sure the "Balance Letter.rtf" template is in the same directory where you run the cURL command.
curl -X POST -u username:password -H "Content-Type:multipart/form-data" -F 'TemplateData=@Balance Letter.rtf;type=application/octet-stream' -F 'ReportRequest={"absolutePath":"FolderName/SubFolderName/","dataModelPath":"/Sample Lite/Published Reporting/Data Models/Balance Letter Datamodel.xdm","name":"ReportName","update":false};type=application/json' http://host.com:port/xmlpserver/services/rest/v1/reports
Create a report with a custom template and XLIFF data
The following example shows how to create a report using a custom template and XLIFF data by submitting a POST request on the REST resource using cURL.
Make sure the "Balance Letter.rtf" template and the XLIFF data is in the same directory where you run the cURL command.
curl -X POST -u username:password -H "Content-Type:multipart/form-data" -F 'XliffData=@translation.xlf;type=application/octet-stream' -F 'TemplateData=@Balance Letter.rtf;type=application/octet-stream' -F 'ReportRequest={"absolutePath":"FolderName/SubFolderName/","dataModelPath":"/Sample Lite/Published Reporting/Data Models/Balance Letter Datamodel.xdm","name":"ReportName","update":false};type=application/json' http://host.oracle.com:port/xmlpserver/services/rest/v1/reports