Get the layout of a dimension
Get the layout of a dimension by using the GetLayout method.
Example
In this example, the first step is to create a dimension and then to display its layout.
1. Create the dimension Dimension01. The label of the dimension is Count of Country. Its definition is Count(Country).
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "CreateDimension",
"handle": 1,
"params": [
{
"qInfo": {
"qId": "Dimension02",
"qType": "Dimension"
},
"qDim": {
"qGrouping": "N",
"qFieldDefs": [
"ProductName"
],
"qFieldLabels": [
"Product name lib label"
]
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qReturn": {
"qType": "GenericDimension",
"qHandle": 3
},
"qInfo": {
"qId": "Dimension02",
"qType": "Dimension"
}
},
"change": [
3
]
}
The dimension is created and has 3 as a handle.
2. Display the layout of the dimension. The handle of the request is 3 because the dimension has 3 as a handle.
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "GetLayout",
"handle": 3,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"qLayout": {
"qInfo": {
"qId": "Dimension02",
"qType": "Dimension"
},
"qDim": {
"qGrouping": "N",
"qFieldDefs": [
"ProductName"
],
"qFieldLabels": [
"Product name lib label"
]
},
"qDimInfos": [
{
"qApprMaxGlyphCount": 31,
"qCardinal": 10,
"qTags": [
"$text"
]
}
]
}
}
}
The identifier, the label and the definition of the dimension are returned. The number of distinct values (in qCardinal), the length of the longest value in the field (in qApprMaxGlyphCount) and the type of the field (in qTags) are also returned.