1. Create a chart with one dimension Country and one measure Count(Holes).
The client sends:
{
"jsonrpc": "2.0",
"id": 1,
"method": "CreateSessionObject",
"handle": 1,
"params": [
{
"qInfo": {
"qId": "",
"qType": "Chart"
},
"qHyperCubeDef": {
"qStateName": "$",
"qDimensions": [
{
"qLibraryId": "",
"qNullSuppression": false,
"qDef": {
"qGrouping": "N",
"qFieldDefs": [
"Country"
],
"qFieldLabels": [
"Country label"
]
}
}
],
"qMeasures": [
{
"qLibraryId": "",
"qSortBy": {
"qSortByState": 0,
"qSortByFrequency": 0,
"qSortByNumeric": 0,
"qSortByAscii": 0,
"qSortByLoadOrder": 1,
"qSortByExpression": 0,
"qExpression": {
"qv": ""
}
},
"qDef": {
"qLabel": "",
"qDescription": "",
"qTags": [
"tags"
],
"qGrouping": "N",
"qDef": "Count(Holes)"
}
},
{
"qLibraryId": "",
"qSortBy": {
"qSortByState": 0,
"qSortByFrequency": 0,
"qSortByNumeric": 0,
"qSortByAscii": 0,
"qSortByLoadOrder": 1,
"qSortByExpression": 0,
"qExpression": {
"qv": ""
}
},
"qDef": {
"qLabel": "",
"qDescription": "",
"qTags": [
"tags"
],
"qGrouping": "N",
"qDef": ""
}
}
],
"qInitialDataFetch": [
{
"qTop": 0,
"qLeft": 0,
"qHeight": 3,
"qWidth": 1
},
{
"qTop": 0,
"qLeft": 0,
"qHeight": 0,
"qWidth": 0
},
{
"qTop": 0,
"qLeft": 0,
"qHeight": 0,
"qWidth": 0
}
]
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 2
}
},
"change": [
2
]
}
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 given (qPath is /qHyperCubeDef). The name of the exported file is CsvUTF8.csv (in qFileName).
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "ExportData",
"handle": 2,
"params": [
"CSV_C",
"/qHyperCubeDef",
"CsvUTF8.csv"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"qUrl": "/Exports/CsvUTF8(a98f4186-2d81-4be8-837a-911e41e8377a).csv"
}
}
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: