Export the data of a generic object
Export the data of a generic object by using the ExportData method.
Examples
Example 1:
1. Create a chart with one dimension Country and one measure Count(Holes).
The client sends:
The engine returns:
The chart is created and has 2 as a handle.
2. Export the data of the chart to a CSV file (qFileType is CSV_C). The handle of the request is 2 because the handle of the chart is 2. The path to the definition of the chart is /qHyperCubeDef (qPath is /qHyperCubeDef). The name of the exported file is CsvUTF8.csv (in qFileName).
The client sends:
The engine returns:
The data of the chart is exported to a CSV file.
The file is renamed to what is passed as argument (in qFileName) by the browser after download. This is done by sending content-disposition in the header of the response from HTTP Get on the URL returned by the ExportData call.
Chart as in the example:
Exported data:
Example 2:
Prerequisite:
A pivot table is created. The handle of the pivot table is 2.
The hypercube is defined as follows:
Regarding the above definition, the hypercube has the following properties:
- Is a pivot table ("qMode": "EQ_DATA_MODE_PIVOT")
- Has four dimensions defined in the following order: CategoryName, ProductName, City and Customer.
-
The measure is Sum(OrderTotal).
- The inter column sort order is [0,1, 3, 2].
- Contains 3 left dimensions ("qNoOfLeftDims": 3).
- The cells are always fully expanded ("qAlwaysFullyExpanded": true).
- CategoryName, ProductName and Customer are left dimensions (according to the inter column sort order and the number of left dimensions).
- City is a top dimension (according to the inter column sort order (qInterColumnSortOrder ) and the number of left dimensions (qNoOfLeftDims)).
Export the data from the pivot table to an xlsx file (qFileType is OOXML) using the ExportData method.
In the example below, the handle of the request is 2 because the handle of the pivot table is 2. The path to the definition of the pivot table is: /qHyperCubeDef (qPath is /qHyperCubeDef).
The client sends:
The engine returns:
The data is exported to axlsx file.
Exported data: