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>,
							"fl":<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"

In this parameter specifies the grouping of the table.

Example

"p":"{
	\"grouping\":\"	
	{\\\"type\\\":\\\"total\\\",\\\"nested\\\":		/* enable grouping "Total" */
		{\\\"type\\\":\\\"year\\\"}}\"			/* enable nested grouping "Year" */
	}

Basic grouping types

Type Description
total Total
year Year
month Month
week Week
wday Day of the week
mday Day of the month
day Date
shift Shift

Advanced grouping types you can find with request (parameter gt) Get list of table types

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\"}}"

For driver_ddd table (“Driver activity”) can be used parameter:

drv_activity (Driver activity source)

"p": "{
	\"drv_activity\":<text>
}" 
Value Description
ddd use data from .ddd files (on default)
online use data from online activities

Advanced settings

Each setting of template is a column of the table. To activate an option - add to the template corresponding column.

Accesible settings

Table Column Description
unit_stats multi_drivers Multiple drivers/trailers
unit_stats precise_calculations Mileage/fuel/counters with accuracy to two decimal places
unit_stats exclude_thefts Exclude thefts from fuel consumption
unit_stats trips_mileage Mileage from trips only
unit_stats intersect_zone Consider track-geofence
unit_stats address_format Address Format
unit_stats time_format Time Format
unit_stats us_units Measurement
unit_stats shifts Shifts
pois render_pois Render POIs
pois group_markers Group icons
pois number_markers Marker numbering
pois use_visibility_scales Consider POI visibility scale
unit_trips render_msgs All messages on map
unit_trips render_trips Trip routes
geozones render_geozones Render geofences
unit_videos render_unit_videos Video markers
unit_fillings render_filling_markers Filling markers
unit_photos render_unit_photos Image markers
unit_stops render_stops_markers Stop markers
unit_speedings render_speedings_markers Speeding markers
unit_thefts render_theft_markers Theft markers
unit_events render_events_markers Event markers
unit_stays render_stays_markers Parking markers
unit_location render_location_markers Unit last location
unit_stats_zones all_resources POIs and geofences from all resources
unit_stats_zones desc_address Add POI/geofence description to address
unit_stats_zones address_pois Use POIs for addresses
unit_stats_zones address_zones Use geofences for addresses

:!: Adress format, time format, shift and measurement specified in “p”.

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
]