Exporting a Report Element

Exports a report element to one of the following formats:

  • HTML
  • MHTML
  • XML
  • PDF
  • MS Excel 2003
  • MS Excel 2007
  • CSV
Caution
  • 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.
  • You cannot export a whole page zone (header, footer, or body). This generates a 400 HTTP request.
Request

GET <webiURL>/documents/{documentId}/reports/{reportId}/elements/{elementId}?[parameters]

Where:
  • {documentId} is the document identifier retrieved from the list of documents
  • {reportId} is the report identifier retrieved from the list of reports
  • {elementId} is the element identifier retrieved from the list of elements of a report
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
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
chartOutputFormat

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

HTML
optimized

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

Excel 2003 and 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.
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 MS Excel 2003
  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for MS Excel 2007
  • text/csv for CSV

Example

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

Example

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

Example

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

Example

MS Excel 2003
curl -G -s -H "accept:application/vnd.ms-excel" -H "X-SAP-LogonToken:""%tokenValue%"""
 "<webiURL>/documents/9227/reports/1/elements/4?dpi=150&optimized=true" > reportelement4.xls

Example

MS Excel 2007
curl -G -s -H "accept:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" 
 -H X-SAP-LogonToken:"""%tokenValue%"""
 "<webiURL>/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%"""
 "<webiURL>/documents/9227/reports/1/elements/4?textQualifier='&columnDelimiter=,&charset='UTF-8'" > reportelement4.csv