1. Create the chart Chart01. The chart contains one dimension ProductName (qFieldDefs is ProductName) and one measure.
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "CreateObject",
"handle": 1,
"params": [
{
"qInfo": {
"qId": "Chart01",
"qType": "Chart"
},
"qHyperCubeDef": {
"qStateName": "$",
"qDimensions": [
{
"qLibraryId": "",
"qNullSuppression": false,
"qIncludeElemValue": false,
"qDef": {
"qGrouping": "N",
"qFieldDefs": [
"ProductName"
],
"qFieldLabels": [
"ProductName label"
],
"qSortCriterias": [
{
"qSortByState": 0,
"qSortByFrequency": 0,
"qSortByNumeric": 0,
"qSortByAscii": 0,
"qSortByLoadOrder": 1,
"qSortByExpression": 0,
"qExpression": {
"qv": ""
}
},
{
"qSortByState": 0,
"qSortByFrequency": 0,
"qSortByNumeric": 0,
"qSortByAscii": 0,
"qSortByLoadOrder": 1,
"qSortByExpression": 0,
"qExpression": {
"qv": ""
}
}
],
"qNumberPresentations": [
{
"qType": "U",
"qnDec": 10,
"qUseThou": 0,
"qFmt": "",
"qDec": ".",
"qThou": " "
}
],
"qReverseSort": false
},
"qOtherTotalSpec": {
"qOtherMode": "OTHER_OFF",
"qOtherCounted": {
"qv": "10"
},
"qOtherLimit": {
"qv": "0.05"
},
"qOtherLimitMode": "OTHER_GT_LIMIT",
"qSuppressOther": false,
"qForceBadValueKeeping": true,
"qApplyEvenWhenPossiblyWrongResult": true,
"qGlobalOtherGrouping": false,
"qOtherCollapseInnerDimensions": false,
"qOtherSortMode": "OTHER_SORT_DESCENDING",
"qTotalMode": "TOTAL_OFF",
"qReferencedExpression": {
"qv": ""
}
}
}
],
"qMeasures": [
{
"qLibraryId": "",
"qSortBy": {
"qSortByState": 0,
"qSortByFrequency": 0,
"qSortByNumeric": 0,
"qSortByAscii": 0,
"qSortByLoadOrder": 1,
"qSortByExpression": 0,
"qExpression": {
"qv": ""
}
},
"qDef": {
"qLabel": "Chart HC Properties measures label",
"qDescription": "Chart HC Properties measure description",
"qTags": [
"tags"
],
"qGrouping": "N",
"qDef": "Empty",
"qNumFormat": {
"qType": "U",
"qnDec": 10,
"qUseThou": 0,
"qFmt": "",
"qDec": ".",
"qThou": " "
},
"qRelative": false,
"qBrutalSum": false,
"qAggrFunc": "",
"qAccumulate": 0,
"qReverseSort": false
}
}
],
"qSuppressZero": false,
"qSuppressMissing": false,
"qInterColumnSortOrder": [],
"qInitialDataFetch": [
{
"qTop": 0,
"qLeft": 0,
"qHeight": 0,
"qWidth": 0
}
]
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 2
},
"qInfo": {
"qId": "Chart01",
"qType": "Chart"
}
},
"change": [
2
]
}
The chart is created and the handle is 2.
2. Create the chart Chart02 that is linked to the chart Chart01 (qExtendsId is Chart01)).
The chart Chart02 inherits the properties of the chart Chart01.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "CreateObject",
"handle": 1,
"params": [
{
"qInfo": {
"qId": "Chart02",
"qType": "Chart"
},
"qExtendsId": "Chart01"
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 3
},
"qInfo": {
"qId": "Chart02",
"qType": "Chart"
}
},
"change": [
3
]
}
The chart Chart02 is created and has 3 as a handle.
3. Add some soft properties to the chart Chart02 using the ApplyPatches method.
The chart should contain two dimensions CategoryID and ProductID. These new properties should not be persisted (qSoftPatch is true).
The handle of the request is 3 because the chart has 3 as a handle.
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "ApplyPatches",
"handle": 3,
"params": [
[
{
"qPath": "/qHyperCubeDef/qDimensions/0/qDef/qFieldDefs",
"qOp": "add",
"qValue": "[\"CategoryID\",\"ProductID\"]"
}
],
true
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {},
"change": [
3
]
}
The properties of the chart have been updated.
4. Get the properties of the chart Chart01. The handle of the request is 2 because the handle of the chart is 2.
This chart is a master object and contains no soft properties, so the GetProperties method can be used to retrieve the properties.
The client sends:
{
"jsonrpc": "2.0",
"id": 5,
"method": "GetProperties",
"handle": 2,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 5,
"result": {
"qProp": {
"qInfo": {
"qId": "Chart01",
"qType": "Chart"
},
"qMetaDef": {},
"qHyperCubeDef": {
"qStateName": "$",
"qDimensions": [
{
"qDef": {
"qGrouping": "N",
"qFieldDefs": [
"ProductName"
],
"qFieldLabels": [
"ProductName label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1,
"qExpression": {}
},
{
"qSortByLoadOrder": 1,
"qExpression": {}
}
],
"qNumberPresentations": [
{
"qType": "U",
"qnDec": 10,
"qUseThou": 0,
"qDec": ".",
"qThou": " "
}
],
"qActiveField": 0
},
"qOtherTotalSpec": {
"qOtherMode": "OTHER_OFF",
"qOtherCounted": {
"qv": "10"
},
"qOtherLimit": {
"qv": "0.05"
},
"qOtherLimitMode": "OTHER_GT_LIMIT",
"qForceBadValueKeeping": true,
"qApplyEvenWhenPossiblyWrongResult": true,
"qOtherSortMode": "OTHER_SORT_DESCENDING",
"qTotalMode": "TOTAL_OFF",
"qReferencedExpression": {}
},
"qOtherLabel": {},
"qTotalLabel": {},
"qCalcCond": {}
}
],
"qMeasures": [
{
"qDef": {
"qLabel": "Chart HC Properties measures label",
"qDescription": "Chart HC Properties measure description",
"qTags": [
"tags"
],
"qGrouping": "N",
"qDef": "Empty",
"qNumFormat": {
"qType": "U",
"qnDec": 10,
"qUseThou": 0,
"qDec": ".",
"qThou": " "
},
"qAccumulate": 0,
"qActiveExpression": 0,
"qExpressions": []
},
"qSortBy": {
"qSortByLoadOrder": 1,
"qExpression": {}
},
"qAttributeExpressions": [],
"qCalcCond": {}
}
],
"qInterColumnSortOrder": [],
"qInitialDataFetch": [
{
"qLeft": 0,
"qTop": 0,
"qWidth": 0,
"qHeight": 0
}
],
"qReductionMode": "N",
"qMode": "S",
"qPseudoDimPos": -1,
"qNoOfLeftDims": -1,
"qMaxStackedCells": 5000,
"qCalcCond": {}
}
}
}
}
The properties of the chart are returned. The dimension of the chart is ProductName.
5. Get the properties of the chart Chart02. The handle of the request is 3 because the handle of the chart is 3.
This chart is a linked object and contains some soft properties, so the GetEffectiveProperties method should be used to retrieve all the properties (including the soft properties and the properties of the linking object/ master object).
The client sends:
{
"jsonrpc": "2.0",
"id": 6,
"method": "GetEffectiveProperties",
"handle": 3,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 6,
"result": {
"qProp": {
"qInfo": {
"qId": "Chart02",
"qType": "Chart"
},
"qExtendsId": "Chart01",
"qMetaDef": {},
"qHyperCubeDef": {
"qStateName": "$",
"qDimensions": [
{
"qDef": {
"qGrouping": "N",
"qFieldDefs": [
"CategoryID",
"ProductID"
],
"qFieldLabels": [
"ProductName label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1,
"qExpression": {}
},
{
"qSortByLoadOrder": 1,
"qExpression": {}
}
],
"qNumberPresentations": [
{
"qType": "U",
"qnDec": 10,
"qUseThou": 0,
"qDec": ".",
"qThou": " "
}
],
"qActiveField": 0
},
"qOtherTotalSpec": {
"qOtherMode": "OTHER_OFF",
"qOtherCounted": {
"qv": "10"
},
"qOtherLimit": {
"qv": "0.05"
},
"qOtherLimitMode": "OTHER_GT_LIMIT",
"qForceBadValueKeeping": true,
"qApplyEvenWhenPossiblyWrongResult": true,
"qOtherSortMode": "OTHER_SORT_DESCENDING",
"qTotalMode": "TOTAL_OFF",
"qReferencedExpression": {}
},
"qOtherLabel": {},
"qTotalLabel": {},
"qCalcCond": {}
}
],
"qMeasures": [
{
"qDef": {
"qLabel": "Chart HC Properties measures label",
"qDescription": "Chart HC Properties measure description",
"qTags": [
"tags"
],
"qGrouping": "N",
"qDef": "Empty",
"qNumFormat": {
"qType": "U",
"qnDec": 10,
"qUseThou": 0,
"qDec": ".",
"qThou": " "
},
"qAccumulate": 0,
"qActiveExpression": 0,
"qExpressions": []
},
"qSortBy": {
"qSortByLoadOrder": 1,
"qExpression": {}
},
"qAttributeExpressions": [],
"qCalcCond": {}
}
],
"qInterColumnSortOrder": [],
"qInitialDataFetch": [
{
"qLeft": 0,
"qTop": 0,
"qWidth": 0,
"qHeight": 0
}
],
"qReductionMode": "N",
"qMode": "S",
"qPseudoDimPos": -1,
"qNoOfLeftDims": -1,
"qMaxStackedCells": 5000,
"qCalcCond": {}
}
}
}
}
The properties of the chart Chart02 are returned. The chart has two dimensions: CategoryID and ProductID, which means that the soft properties that were previously added are returned.
6. Get the properties of the chart Chart02 using the GetProperties method. The handle of the request is 3 because the handle of the chart is 3.
The client sends:
{
"jsonrpc": "2.0",
"id": 7,
"method": "GetProperties",
"handle": 3,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 7,
"result": {
"qProp": {
"qInfo": {
"qId": "Chart02",
"qType": "Chart"
},
"qExtendsId": "Chart01",
"qMetaDef": {}
}
}
}
The properties of the linking object (of the Chart01) are not returned. Only the identifier and the type of the linked object and the identifier of the linking object are returned.