select_result_rows
The select_result_rows function is used to get rows in multilevel reports.
svc = report/select_result_rows¶ms={
"tableIndex": <int>,
"config": {
"type": "<text>",
"data": {}
}
}
Parameters
Name | Description |
---|---|
tableIndex | Table index. |
config | Configuration. |
type | The request type:
|
data | The data for the configuration. |
If the type parameter is range, the data parameter has the following format:
"data":{
"from":<uint>,
"to":<uint>,
"level":<uint>,
"flat":<uint>,
"rawValues":<uint>,
"unitInfo":<uint>
}
Option | Description |
---|---|
from | The index of the first row. |
to | The index of the last row. |
level | Nesting level. |
flat | Show the nesting level on the same level with the parent row:
The parameter is optional. The default value is 0. |
rawValues | Show the parameters v, vt:
The parameter is optional. The default value is 0. |
unitInfo | Show uid:
The parameter is optional. The default value is 0. |
If the type parameter is row, the data parameter has the following format:
"data": {
"rows": [<int>],
"level": <uint>,
"flat": <int>,
"rawValues": <uint>,
"unitInfo": <uint>,
"from": <int>,
"to": <int>
}
Option | Description |
---|---|
rows | The index of the row. You can indicate the index of a nested row to up to next-to-last nesting level. |
level | Nesting level. |
flat | Show the nesting level on the same level with the parent row:
The parameter is optional. The default value is 0. |
from | The index of the first nested row (optional). |
to | The index of the last nested row (optional). |
rawValues | Show the raw values data:
The parameter is optional. The default value is 0. |
unitInfo | Show uid:
The parameter is optional. The default value is 0. |
Returned result
[
{
"n": <uint>, /* row index (from 0) */
"i1": <uint>, /* the number of the first message in the specified interval */
"i2": <uint>, /* the number of the last message in the specified interval */
"t1": <uint>, /* the time of the first message in the specified interval */
"t2": <uint>, /* the time of the last message in the specified interval */
"d": <int>, /* the quantity of the rows with the next nesting level */
"uid": <long>, /* unit ID; only if unitInfo is set to 1 */
"c": [ /* the array of cells */
{ /* common cell type */
"t": "<text>", /* formatted cell value */
"v": <double>, /* original cell value */
"vt": <double>, /* value type */
"pi": { /* property items */
"t": "<text>", /* property items type */
"ids": [ /* the array of property item IDs */
]
},
"y": <double>, /* latitude */
"x": <double>, /* longitude */
"c": "<text>" /* cell colour (only if cell has a colour) in "RRGGBB" format */
},
{ /* cell type: video or image */
"t": "<text>", /* cell value text */
"j": <JSON>, /* cell value in JSON format */
"v": <double>, /* cell value */
"vt": <int> /* cell value type */
}
],
"r": [ /* holds the subrows which correspond to the requested nesting level */
{ /* the set of fields of the row will be the same as that of the parent row */
"n": <uint>,
"i1": <uint>,
"i2": <uint>,
...
}
]
}
]
The value types are described here.
Possible error codes:
Code | Description |
---|---|
7 | Failed to fetch the report library. |
6 | Failed to fetch the user. |
5 | Report file reading/writing error. |
4 | Wrong input parameters. |