问题
In a reporting application we use, we were using BI 3.x API to produce Web reports. While doing the migration activity to 4.x version, we thought it is fine to go with open doc url rather than doing the report generation through API.
Many of the samples I have seen uses sIDType and iDocID parameters along with Token value to retrieve the document by constructing a URL like below http://server:port/BOE/OpenDocument/opendoc/openDocument.jsp?token=[LogonToken]&iDocID=[XXXX]&sIDType=CUID
But all those URLs get HTML page as response from BI 4.x SAP webservice, the java script in that HTML page does the task of retrieving the pdf file.
I am just wondering if there is any way I could retrieve the pdf report as response from the BI Webservice directly ? Please assist me on this. Thanks
回答1:
You can if you use the REST SDK to retrieve the document, refresh it and then export it to PDF.
In short, these are the steps:
- Logon:
POST /biprws/logon/long
- Get the doc's prompts (if any)
GET /biprws/raylight/v1/documents/5690743/parameters
- Pass the correct values for the prompts (if any) and refresh the document:
PUT /biprws/raylight/v1/documents/5690743/parameters
- Export as PDF
GET /biprws/raylight/v1/documents/5690743
That last step requires you to pass Accept: application/pdf
in your HTTP headers to get the PDF version.
Detailed information on the REST SDK and the different steps listed above is available on help.sap.com (look for the manual SAP BusinessObjects RESTful Web Service SDK User Guide for Web Intelligence and the BI Semantic Layer).
回答2:
Use sOutputFormat=P to always retrieve the PDF of the report using open doc
来源:https://stackoverflow.com/questions/35310121/sap-bi-open-doc-url-for-retrieving-pdf