SAP BI Open Doc URL for retrieving PDF

4.8k Views Asked by At

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 Web service, the Javascript 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.

2

There are 2 best solutions below

3
On BEST ANSWER

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:

  1. Logon: POST /biprws/logon/long
  2. Get the doc's prompts (if any) GET /biprws/raylight/v1/documents/5690743/parameters
  3. Pass the correct values for the prompts (if any) and refresh the document: PUT /biprws/raylight/v1/documents/5690743/parameters
  4. 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).

0
On

Use sOutputFormat=P to always retrieve the PDF of the report using open doc