select_result_rows

The select_result_rows function is used to get rows in multilevel reports.

Copied!
svc=report/select_result_rows&params={"tableIndex":<int>,
				      				  "config":{
				      					  "type":"<text>",
				      					  "data":{}
				      				  }}

Parameters

NameDescription
tableIndexTable index.
configConfiguration.
typeThe request type:
  • range — ordered sequence of rows;
  • row — row.
dataThe data for the configuration.

If the type parameter is range, the data parameter has the following format:

Copied!
"data":{
	"from":<uint>,
	"to":<uint>,
	"level":<uint>,
	"flat":<uint>,
	"rawValues":<uint>,
	"unitInfo":<uint>
}

OptionDescription
fromThe index of the first row.
toThe index of the last row.
level

Nesting level.

flat

Show the nesting level on the same level with the parent row:

  • 0 — no;
  • 1 — yes.

The parameter is optional. The default value is 0.

rawValues

Show the parameters v, vt:

  • 0 — no;
  • 1 — yes.

The parameter is optional. The default value is 0.

unitInfo

Show uid

  • 0 — no;
  • 1 — yes.

The parameter is optional. The default value is 0.

If the type parameter is row, the data parameter has the following format:

Copied!
"data":{
	"rows":[<int>],
	"level":<uint>,
	"flat":<int>,
	"rawValues":<uint>,
	"unitInfo":<uint>,
	"from":<int>,
	"to":<int>	
}

OptionDescription
rowsThe 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:

  • 0 — no;
  • 1 — yes.

The parameter is optional. The default value is 0.

fromThe index of the first nested row (optional).
toThe index of the last nested row (optional).
rawValues

Show the raw values data:

  • 0 — no;
  • 1 — yes.

The parameter is optional. The default value is 0.

unitInfo

Show uid

  • 0 — no;
  • 1 — yes.

The parameter is optional. The default value is 0.

Returned result

Copied!
[
	{
		"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:

CodeDescription
7Failed to fetch the report library.
6Failed to fetch the user.
5Report file reading/writing error.
4Wrong input parameters.
Download PDF file
Download Word document

See also