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



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 param specifies the grouping of the table and other settings.


	{\\\"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": "{
Param Description On default
group whether to group elements:
0 - no,
1 - yes
types element types included in table results:
all included

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


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

drv_activity (Driver activity source)

"p": "{
Value Description
ddd use data from .ddd files (on default)
online use data from online activities

For driver_orders table (“Orders”) can be used parameter:

order_filter (“Filtration”)

Value Description
0x1 visited orders
0x2 not visited orders
0x4 in time completed orders
0x8 overdue completed orders
0x10 confirmed and rejected orders
0x20 not confirmed and not rejected orders
0x40 confirmed orders
0x80 rejected orders

For unit_counter_sensors (“Counter sensors”) can be used parameters:

sensor_val:min (minimum sensor value) sensor_val:max (maximum sensor value)

"p": "{

For charts:

	\"sensor_mask\":<text>,		/* sensor mask */
		\"mask\":<text>}}	/* sensor mask to paint chart line by sensor */

For tables with shifts, to split shift - use params:



Chart is a table in template. To add markers on the chart - add marker table to the template and add markers flags to the chart table.

Marker table codesample.


Markers flags codesample.


Available markers/states.

Marker Flag Description
unit_events 0x4 Events
unit_fillings 0x8 Fillings
unit_photos 0x10 Images
unit_stays 0x20 Parkings
unit_speedings 0x40 Speeding
unit_stops 0x80 Stops
unit_thefts 0x100 Thefts
unit_videos 0x800 Video
unit_engine_hours - Engine hours
unit_conn_quality - Connection loss

To change charts background according to units state - add marker/state to the template and add chart_regions param to the chart table.

Charts background change codesample.

  {\"id\":\"chart_engine_hours_regions\",\"color\":16381105,\"priority\":4,\"name\":\"Engine hours\"},
  {\"id\":\"chart_conn_quality_regions\",\"color\":14474460,\"priority\":3,\"name\":\"Connection loss\"},
  ... }

Available state.

id Description
chart_stops_regions Stops
chart_engine_hours_regions Engine hours
chart_conn_quality_regions Connection loss
chart_stays_regions Parkings
chart_trips_regions Trips

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
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 geofences from all resources
unit_stats_zones desc_address Add geofence description to address
unit_stats_zones address_zones Use geofences for addresses

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


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 */
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon info@gurtam.com   |   Copyright © 2002-2023 Gurtam