Exporting a Page of a Report

Usage

Exports one given page of a report in one of the following formats:

  • HTML
  • Zipped HTML
  • MHTML (multipart HTML)
  • XML
  • PDF
  • Microsoft Excel 2003
  • Microsoft Excel 2007
Note
  • If you choose the HTML format, the web service generates the image links. Therefore, the logon token must still be valid when the HTML output is displayed.
  • Exports to HTML will be optimized for your browser if you use the User-Agent HTTP header in the REST API call.
Request

GET /documents/<documentID>/reports/<reportID>/pages/<pageIndex>?<optional_parameters>

Where:
  • <pageIndex> is the number of the page to export. It begins with 1 and while the number of report pages is not known in advance, you have to use this URL in a loop, which returns the 404 error message "Not Found" after the last found page.
Remember To export the last page of the report, use GET /documents/<documentID>/reports/<reportID>/pages/last.
Table 1: Optional Parameters
Parameter Description Supported Formats
dpi

Resolution in dots per inch (dpi) for generated charts. Value between 75 and 9600. Default is 300 for PDF format, 96 for all other formats.

All
mode

normal (default) or quickDisplay.

All
orientation

Page orientation. Used to force a specific page orientation. Values are portrait and landscape.

If mode=normal
widthScaling

Number of pages per report displaying in width. The document setting applies by default.

If mode=normal
heightScaling

Number of pages per report displaying in height. The document setting applies by default.

Ifmode=normal
chartOutputFormat

Output format for generated chart. Values are: jpeg, bmp, gif, and png (default).

HTML, ZIP and MHTML

imageUrl String used to customize image links when they cannot be reached from the information system. HTML
fileName

A string that defines the name of the ZIP file. If set, the HTML output is zipped to a fileName.zip file. Maximum string length is 96.

ZIP
unit

A string that defines the unit that sizes will be reported in. Values are "metric", "millimeter", "point", and "pixel" (default).

XML
rawValues Boolean. Default is false. If true, the raw values and their types are exported with the formatted values. XML
optimized

Boolean. Default is false. If true, the generated output is optimized for calculations inside Microsoft Excel..

Microsoft Excel 2003 and Microsoft Excel 2007

Customization of Image Links

You may need to customize the source of an image in a page exported as HTML if the image is unreachable by your system:

<img border="0" style="position:absolute;top:0px;left:0px;width:400px;height:300px;"
    alt="3D Column Chart" src="http://dewdfwadept1054.dhcp.wdf.sap.corp:6405/biprws/
    raylight/v1/documents/6406/reports/1/pages/1/images/dxXMLDraft.drilloff_1*2*6?
    X-SAP-LogonToken={X-SAP-LogonToken}">
</img>

To do this, use the imageUrl parameter with an appropriate value in the GET call:

GET /documents/6406/reports/1/pages/0?reference=1.D.7&imageUrl=http%3A%2F%2FmyServer%2FmyPage.jsp

The resulting image link looks like:

<img border="0" style="position:absolute;top:0px;left:0px;width:400px;height:300px;"
    alt="3D Column Chart" src="http://myServer/myPage.jsp?documentId=6406&reportId=
    1&pageId=1&imageId=dxXMLDraft.drilloff_1*2*6&X-SAP-LogonToken={X-SAP-LogonToken}">
</img>
Response
Response type:
  • text/html
  • application/zip for zipped HTML
  • multi-part/related for MHTML
  • text/xml
  • application/pdf
  • application/vnd.ms-excel for Microsoft Excel 2003
  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for Microsoft Excel 2007

Response body: the report in the expected format.

Example

XML
curl -H "accept:text/xml" -H X-SAP-LogonToken:"""%tokenValue%"""
 "<base_webi_REST_URL>/documents/9646/reports/479/pages/1" > page1.xml

Example

PDF
curl -H "accept:application/pdf" -H X-SAP-LogonToken:"""<tokenValue>"""
 "<base_webi_REST_URL>/documents/9646/reports/479/pages/2" > page2.pdf

Example

Microsoft Excel 2003
curl -H "accept:application/vnd.ms-excel" -H X-SAP-LogonToken:"""<tokenValue>"""
 "<base_webi_REST_URL>/documents/9646/reports/479/pages/3" > page3.xls

Example

Microsoft Excel 2007
curl -G -s -H "accept:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
 -H X-SAP-LogonToken:"""<tokenValue>""" "<base_webi_REST_URL>/documents/9646/reports/479/pages/1"
 > page1.xlsx