1. Create a transient list object. In this example, the list object contains one dimension Country (qFieldDefs is Country) and two expressions Count(CategoryName) and Sum(ProductID).
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "CreateSessionObject",
"handle": 1,
"params": [
{
"qInfo": {
"qId": "",
"qType": "Chart"
},
"qHyperCubeDef": {
"qDimensions": [
{
"qLibraryId": "",
"qDef": {
"qFieldDefs": [
"Country"
],
"qFieldLabels": [
"Label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1
}
],
"qReverseSort": false,
"dynamic_property": {
"qValueExpression": "=Count(CategoryName)"
},
"dynamic_property_2": {
"qValueExpression": "Count(CategoryName)"
},
"dynamic_property_3": {
"qValueExpression": {
"qExpr": "=Sum(ProductID)"
}
}
}
}
],
"qMeasures": [
{
"qLibraryId": "",
"qDef": {
"qLabel": "Chart HC Properties measures label",
"qDef": "Empty"
}
}
],
"qSuppressZero": true,
"qSuppressMissing": true,
"qInitialDataFetch": [
{
"qTop": 0,
"qHeight": 1,
"qLeft": 0,
"qWidth": 2
}
]
}
}
],
"cont": false,
"delta": false
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 2
}
},
"change": [
2
]
}
The list object is created and has 2 as a handle.
See: CreateSessionObject method.
2. Get the layout of the list object. The handle of the request is 2 because the list object has 2 as a handle.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "GetLayout",
"handle": 2,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qLayout": {
"qInfo": {
"qId": "ed91be2a-8201-454d-aa3e-f10ce7360863",
"qType": "Chart"
},
"qSelectionInfo": {},
"qHyperCube": {
"qSize": {
"qcx": 2,
"qcy": 0
},
"qDimensionInfo": [
{
"qFallbackTitle": "Label",
"qApprMaxGlyphCount": 7,
"qCardinal": 1,
"qSortIndicator": "A",
"qGroupFallbackTitles": [
"Label"
],
"qGroupPos": 0,
"qStateCounts": {
"qLocked": 0,
"qSelected": 0,
"qOption": 1,
"qDeselected": 0,
"qAlternative": 0,
"qExcluded": 0,
"qSelectedExcluded": 0,
"qLockedExcluded": 0
},
"qTags": [
"$ascii",
"$text"
],
"qDimensionType": "D",
"qGrouping": "N",
"qNumFormat": {
"qType": "R",
"qnDec": 14,
"qUseThou": 1,
"qFmt": "##############",
"qDec": ","
},
"qIsAutoFormat": true,
"qGroupFieldDefs": [
"Country"
],
"dynamic_property": 5,
"dynamic_property_2": 5,
"dynamic_property_3": 2300
}
],
"qMeasureInfo": [
{
"qFallbackTitle": "Chart HC Properties measures label",
"qApprMaxGlyphCount": 1,
"qCardinal": 0,
"qSortIndicator": "N",
"qNumFormat": {
"qType": "U",
"qnDec": 0,
"qUseThou": 0
},
"qMin": "NaN",
"qMax": "NaN",
"qIsAutoFormat": true,
"qAttrExprInfo": []
}
],
"qEffectiveInterColumnSortOrder": [
0,
1
],
"qGrandTotalRow": [
{
"qText": "-",
"qNum": "NaN",
"qElemNumber": -1,
"qState": "X",
"qIsTotalCell": true
}
],
"qDataPages": [
{
"qMatrix": [],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 0,
"qHeight": 0
}
}
],
"qPivotDataPages": [],
"qStackedDataPages": [],
"qMode": "S",
"qNoOfLeftDims": -1
}
}
}
}
The evaluation of the first two value expressions returns the numeric 5 (the result is the same with or without the "=" sign) and the evaluation of the third value expression returns the numeric 2300.
See: GetLayout method.