1

Vehicle group report template Node.js

(20/11/2018 16:50:07 отредактировано Gab)

Тема: Vehicle group report template Node.js

Can you get the reports of a group of vehicles?
In the wialon platform we created a template that allows you to obtain the trip report of a vehicle group, but we need to store this data.
I know that repor / exec_report generate the report, but with the id of the unit.
So my question is, how can I generate this report for the group of units?

If I enter the id of the group, you must know the id of the unit generates error 4.

function execReport () {
    var    params = {
        "reportResourceId": 17976293,
        "reportTemplateId":8,
        "reportObjectId":17723259, //ID of group 
        "reportObjectSecId":0,
        "interval":{
            "from":1539302401,
            "to":1539388799,
            "flags":0
            }
    };
    request.post({
        url: URL + 'svc=report/exec_report',
        json: true,
        form: {
            sid: SID,
            params: JSON.stringify(params)
        }
    }, function (error, response, body) {
        console.log(body);
        //resultRowsTravel();
    });
2

Vehicle group report template Node.js

(20/11/2018 20:37:16 отредактировано cerpas)

Re: Vehicle group report template Node.js

In your request I'm not see the param reportObjectIdList normally for an unit group report you need a request same to:

{
  "reportResourceId": 13757,
  "reportTemplateId": 20,
  "reportTemplate": null,
  "reportObjectId": 17303,
  "reportObjectSecId": 0,
  "interval": {
    "flags": 0,
    "from": 1542693600,
    "to": 1542779999
  },
  "reportObjectIdList": [
    
  ]
}

Regards