The source object contains one child and the destination object contains no children.
Prerequisites steps before the copy from:
- Creation of the first object
- Creation of the second object
- Creation of a child in the first object
1. Create the first object. The identifier of the object (qId) is Sheet01. The type of the object (qType) is Sheet. A title and a description are set.
The client sends:
{
"jsonrpc": "2.0",
"id": 1,
"method": "CreateObject",
"handle": 1,
"params": [
{
"title": "Title of Sheet01",
"description": "Description of Sheet01",
"qInfo": {
"qId": "Sheet01",
"qType": "sheet"
},
"qChildListDef": {
"qData": {
"title": "/title",
"description": "/description",
"meta": "/meta",
"order": "/order",
"id": "/qInfo/qId",
"type": "/qInfo/qType",
"lb": "/qListObjectDef",
"hc": "/qHyperCubeDef"
}
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 2
},
"qInfo": {
"qId": "Sheet01",
"qType": "sheet"
}
},
"change": [
2
]
}
The sheet Sheet01 is created. The handle of this sheet is 2.
2. Create the second object. The identifier of the object (qId) is Sheet02. The type of the object (qType) is Sheet. A title and a description are set.
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "CreateObject",
"handle": 1,
"params": [
{
"title": "Title of Sheet02",
"description": "Description of Sheet02",
"qInfo": {
"qId": "Sheet02",
"qType": "sheet"
},
"qChildListDef": {
"qData": {
"title": "/title",
"description": "/description",
"meta": "/meta",
"order": "/order",
"id": "/qInfo/qId",
"type": "/qInfo/qType",
"lb": "/qListObjectDef",
"hc": "/qHyperCubeDef"
}
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 3
},
"qInfo": {
"qId": "Sheet02",
"qType": "sheet"
}
},
"change": [
3
]
}
The sheet Sheet02 is created. The handle of this sheet is 3.
3. Create a child object in the first sheet. The identifier of the child object (qId) is Child01. The type of the child object (qType) is Chart. A description is set for the child. The handle of the request is 2 because the handle of the first sheet is 2.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "CreateChild",
"handle": 2,
"params": [
{
"qInfo": {
"qId": "Child01",
"qType": "Chart"
},
"qHyperCubeDef": {
"qStateName": "$",
"qDimensions": [
{
"qLibraryId": "",
"qNullSuppression": false,
"qDef": {
"qGrouping": "N",
"qFieldDefs": [
""
],
"qFieldLabels": [
""
]
}
}
],
"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": ""
}
}
]
},
"description": "Child of Sheet01"
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 4
},
"qInfo": {
"qId": "Child01",
"qType": "Chart"
}
},
"change": [
4
]
}
The child Child01 is created. The handle of the child is 4.
4. Copy the properties and children of the object Sheet01 in the object Sheet02. The handle of the request is 3 because the handle of the object Sheet02 is 3. The identifier of the source object is Sheet01.
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "CopyFrom",
"handle": 3,
"params": [
"Sheet01"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {},
"change": [
3
]
}
The copy is done.
5. Get the layout of the object Sheet02 in order to see that this sheet has inherited the properties and children of the object Sheet01.
The client sends:
{
"jsonrpc": "2.0",
"id": 5,
"method": "GetLayout",
"handle": 3,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 5,
"result": {
"qLayout": {
"qInfo": {
"qId": "Sheet02",
"qType": "sheet"
},
"qSelectionInfo": {},
"title": "Title of Sheet01",
"description": "Description of Sheet01",
"qChildList": {
"qItems": [
{
"qInfo": {
"qId": "cf29ab53-e783-48d5-bad5-57f94daf8d53",
"qType": "Chart"
},
"qData": {
"qHyperCube": {
"qStateName": "$",
"qSize": {
"qcx": 1,
"qcy": 1
},
"qDimensionInfo": [
{
"qApprMaxGlyphCount": 0,
"qCardinal": 0,
"qSortIndicator": "N",
"qGroupFallbackTitles": [
""
],
"qGroupPos": 0,
"qStateCounts": {
"qLocked": 0,
"qSelected": 0,
"qOption": 0,
"qDeselected": 0,
"qAlternative": 0,
"qExcluded": 0,
"qSelectedExcluded": 0,
"qLockedExcluded": 0
},
"qTags": [],
"qError": {
"qErrorCode": 7000
},
"qDimensionType": "D",
"qGrouping": "N",
"qNumFormat": {
"qType": "U",
"qnDec": 10,
"qUseThou": 0
},
"qGroupFieldDefs": [
""
]
}
],
"qMeasureInfo": [
{
"qApprMaxGlyphCount": 1,
"qCardinal": 0,
"qSortIndicator": "A",
"qNumFormat": {
"qType": "U",
"qnDec": 0,
"qUseThou": 0
},
"qMin": "NaN",
"qMax": "NaN",
"qIsAutoFormat": true,
"qAttrExprInfo": []
}
],
"qEffectiveInterColumnSortOrder": [
1
],
"qGrandTotalRow": [
{
"qText": "-",
"qNum": "NaN",
"qElemNumber": -1,
"qState": "X",
"qIsTotalCell": true
}
],
"qDataPages": [],
"qPivotDataPages": [],
"qStackedDataPages": [],
"qMode": "S",
"qNoOfLeftDims": -1
},
"description": "Child of Sheet01",
"title": "",
"meta": "",
"order": "",
"id": "",
"type": "",
"lb": "",
"hc": {
"qStateName": "$",
"qDimensions": [
{
"qDef": {
"qGrouping": "N",
"qFieldDefs": [
""
],
"qFieldLabels": [
""
],
"qSortCriterias": [],
"qNumberPresentations": [],
"qActiveField": 0
},
"qOtherTotalSpec": {
"qOtherMode": "OTHER_OFF",
"qOtherCounted": {},
"qOtherLimit": {},
"qOtherLimitMode": "OTHER_GT_LIMIT",
"qForceBadValueKeeping": true,
"qApplyEvenWhenPossiblyWrongResult": true,
"qOtherSortMode": "OTHER_SORT_DESCENDING",
"qTotalMode": "TOTAL_OFF",
"qReferencedExpression": {}
},
"qOtherLabel": {},
"qTotalLabel": {},
"qCalcCond": {}
}
],
"qMeasures": [
{
"qDef": {
"qTags": [
"tags"
],
"qGrouping": "N",
"qNumFormat": {
"qType": "U",
"qnDec": 10,
"qUseThou": 0
},
"qAccumulate": 0,
"qActiveExpression": 0,
"qExpressions": []
},
"qSortBy": {
"qSortByLoadOrder": 1,
"qExpression": {}
},
"qAttributeExpressions": [],
"qCalcCond": {}
}
],
"qInterColumnSortOrder": [],
"qInitialDataFetch": [],
"qReductionMode": "N",
"qMode": "S",
"qPseudoDimPos": -1,
"qNoOfLeftDims": -1,
"qMaxStackedCells": 5000,
"qCalcCond": {}
}
}
}
]
}
}
}
}
The object Sheet02 has inherited of the properties and children of the object Sheet01. The object Sheet02 contains one child, Child01, and has the same title and description as the object Sheet01. The identifier of the object Sheet02 has not changed.