Exporting a Report Element

Usage

Exports a report element in one of the following formats:

  • HTML
  • Zipped HTML
  • MHTML (multipart HTML)
  • XML
  • PDF
  • Microsoft Excel 2003
  • Microsoft Excel 2007
  • CSV
  • Image of type BMP, GIF, PNG, or JPEG if the report element is a chart
Caution You cannot export a whole page zone (header, footer, or body). This generates a 400 HTTP request.
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 the end-user browser if you use the User-Agent HTTP header in the REST API call.
Request

GET /documents/<documentID>/reports/<reportID>/elements/<elementID>?<optional_parameters>

Table 1: Optional Parameters
Parameter Description Supported Formats
datapath Optional. A string that specifies the data path, for example {elementId}?datapath=DP1.DObc:"2004",DP1.DOa6:"Austin". All
reference Optional. A string that specifies a reference, for example {elementId}?reference=1.D.7. All
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 except XML and CSV
mode

normal or quickDisplay.

All
orientation

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

If mode=normal
widthScaling

Number of pages per report displaying in width. Default is 0 and means no constraint in width.

If mode=normal
heightScaling

Number of pages per report displaying in height. Default is 0 means no constraint in height.

If mode=normal
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
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
optimized

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

Microsoft Excel 2003 and Microsoft Excel 2007
textQualifier

Character used to surround each column value. Values are' or ".

CSV
columnDelimiter

String that defines a character put between columns. Values are comma (,), semi-colon (;) or the special string Tab.

CSV
charset

String that defines a valid server charset retrieved from the list of charsets.

CSV
Caution You cannot use datapath and reference parameters in the same URL. This generates a 400 HTTP request.
Customization of Image Links

You may need to customize the source of an image in a report element 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/elements/13/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/elements/13?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&imageId=dxXMLDraft.drilloff_1*2*6&X-SAP-LogonToken={X-SAP-LogonToken}">
</img>
Response
Response type:
  • text/xml for XML
  • text/html for HTML
  • application/zip for zipped HTML
  • multipart/related for MHTML
  • application/pdf for PDF
  • application/vnd.ms-excel for Microsoft Excel 2003
  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for Microsoft Excel 2007
  • text/csv for CSV
  • image/bmp for BMP images
  • image/gif for GIF images
  • image/png for PNG images
  • image/jpeg or image/jpg for JPEG images

    image/jpg is the returned content type in both cases.

Example

HTML
curl -G -s -H "accept:text/html" -H X-SAP-LogonToken:"""%tokenValue%"""
 "<base_webi_REST_URL>/documents/9227/reports/1/elements/4" > reportelement4.htm

Example

XML
curl -G -s -H "accept:text/xml" -H X-SAP-LogonToken:"""%tokenValue%"""
 "<base_webi_REST_URL>/documents/9227/reports/1/elements/4" > reportelement4.xml

Example

PDF
curl -G -s -H "accept:application/pdf" -H X-SAP-LogonToken:"""%tokenValue%"""
 "<base_webi_REST_URL>/documents/9227/reports/1/elements/4" > reportelement4.pdf

Example

Microsoft Excel 2003
curl -G -s -H "accept:application/vnd.ms-excel" -H "X-SAP-LogonToken:""%tokenValue%"""
 "<base_webi_REST_URL>/documents/9227/reports/1/elements/4?dpi=150&optimized=true" > reportelement4.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/9227/reports/1/elements/4" > reportelement4.xxlsx

Example

CSV

The column delimiter in this example is the comma.

curl -G -s -H "accept:text/csv" -H X-SAP-LogonToken:"""%tokenValue%"""
 "<base_webi_REST_URL>/documents/9227/reports/1/elements/4?textQualifier='&columnDelimiter=,&charset='UTF-8'" > reportelement4.csv

Example

Image
curl -G -s -H "accept:image/bmp" -H X-SAP-LogonToken:"""%tokenValue%"""
 "<base_webi_REST_URL>/documents/9227/reports/1/elements/4?imageUrl=http%3A%2F%2FmyServer%2FmyPage.jsp" > reportelement4.bmp