1. Create a list object and define four dynamic properties with string expressions.
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": {
"qStringExpression": "=Count(CategoryName)"
},
"dynamic_property_2": {
"qStringExpression": "Count(CategoryName)"
},
"dynamic_property_3": {
"qStringExpression": "'Count(CategoryName)'"
},
"dynamic_property_4": {
"qStringExpression": {
"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
]
}
2. Get the layout of the object and check how the dynamic properties are evaluated.
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": "1d7f1e21-76d4-45f8-8e02-1effd115765e",
"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": "Count(CategoryName)",
"dynamic_property_4": "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 two first string expressions returns the string "5" (the result is the same with or without the "=" sign). The third expression surrounded by simple quotes is not evaluated. The fourth expression returns the string "2300".