get_report_data
The get_report_data function is used to get the data of a report template.
svc=report/get_report_data¶ms={"itemId":<long>,
"col":[<long>],
"flags":<uint>}
Parameters
Name | Description |
---|---|
itemId | Resource ID. |
col | The array of template IDs. |
flags | Response flags. |
Response flags:
HEX flag | DEC flag | Description |
---|---|---|
0x0 | 0 | Full JSON (default). |
0x1 | 1 | Basic information and assigned units/groups. |
0x2 | 2 | Basic information and short tables information. |
0x4 | 4 | Basic information and full tables information. |
Returned result
[
{
"id":<long>, /* template ID */
"n":"<text>", /* name */
"ct":"<text>", /* type (see below) */
"c":"<text>", /* data CRC16 */
"p":"<text>", /* parameters */
"tbl":[ /* tables */
{
"n":"<text>", /* table type */
"l":"<text>", /* name */
"c":"<text>", /* the list of columns */
"cl":"<text>", /* the list of column labels */
"cp":"<text>", /* the list of columns parameters */
"s":"<text>", /* the list of columns (if it is a statistics table) */
"sl":"<text>", /* the list of column labels (if it is a statistics table) */
"filter_order":"<text>", /* filters order */
"p":"<text>", /* table parameters */
"sch":{ /* time limitation */
"f1":<uint>, /* the beginning of interval 1 */
"f2":<uint>, /* the beginning of interval 2 */
"t1":<uint>, /* the end of interval 1 */
"t2":<uint>, /* the end of interval 2 */
"m":<uint>, /* days of month mask */
"y":<uint>, /* months mask */
"w":<uint> /* days of week mask */
"fl":<uint> /* incomplete interval (0 — don't cut off, 1 — show and cut off, 2 — don't show in the report, 3 — show and mark as incomplete) */
},
"f":<uint> /* table flags */
}
]
}
]
Template types:
- avl_unit;
- avl_unit_group;
- storage_user;
- avl_driver;
- avl_trailer;
- avl_resource;
- avl_retranslator;
- avl_route;
- avl_drivers_group;
- avl_trailers_group;
- avl_tag;
- avl_tags_group;
- avl_geozone;
- avl_geozones_group;
Table flags are described on the exec_report page.
To get the types of tables which can be included in reports, use the get_report_tables function.
Possible error codes:
Code | Description |
---|---|
7 | Failed to fetch the report object and the report resource with the desired ACL (ADF_ACL_AVL_RES_VIEW_REPORTS). |
4 | Wrong input parameters. |