Table of Contents

Templates

To create, edit and delete report templates, use the command report/update_report:

svc=report/update_report&params={"itemId":<long>,
				 "id":<long>,
				 "callMode":<text>,
				 "n":<text>,
				 "ct":<text>,
				 "p":<text>,
				 "tbl":[
					 {
						"n":<text>,
						"l":<text>,
						"c":<text>,
						"cl":<text>,
						"s":<text>,
						"sl":<text>,
						"p":<text>,
						"sch":{	
							"f1":<uint>,
							"f2":<uint>,
							"t1":<uint>,
							"t2":<uint>,
							"m":<uint>,
							"y":<uint>,
							"w":<uint>
						},
						"f":<uint>
					}
				]}

Parameters

Name Description
itemId resource ID
id template ID
callMode action: create, update, delete

Other parameters are required only to create and edit templates. They are described in the chapter Get templates data.

Param "p"

For “account_tree” table next parameters can be used:

"p": "{
        \"account_tree\":{
                \"group\":<bool>,
                \"types\":<text>
        }
}" 
Param Description On default
group whether to group elements:
0 - no,
1 - yes
group
types element types included in table results:
avl_account
avl_resource
user
avl_unit
avl_unit_group
avl_retranslator
avl_route
all included

Example (all double quotes within the value must be escaped):

    "p":"{\"account_tree\":{\"group\":1,\"types\":\"avl_account,avl_resource,user,avl_unit,avl_unit_group,avl_retranslator,avl_route\"}}"

Response

On create and edit:

[
	<long>,		/* template ID */
	{
		"id":<long>,	/* template ID */
		"n":<text>,	/* name */
		"ct":<text>,	/* template type */
		"c":<uint>	/* check sum (crc16) */
	}
]

Template types are described in the chapter Get templates data.

On delete:

[
	<long>,		/* template ID */
	null
]