1

Getting table rows after exec_report

Тема: Getting table rows after exec_report

Hi , I am up to the point of executing the report request (..svc=report/exec_report..) and receive below response:

{"reportResult":{"msgsRendered":0,"stats":[],"tables":[{"name":"unit_events","label":"Ereignisse","flags":0,"rows":10,"columns":3,"header":["Ereigniszeit","Ereignistext","Position"]}],"attachments":[]}}

Now, I am trying to fetch the table rows, where I am stuck. I did tried:

ajax.html?svc=report/get_report_tables&sid=xxxx

and receive error:4 . Any ideas?
Regards
Venelin

2

Getting table rows after exec_report

Re: Getting table rows after exec_report

To get a list of tables you should send parameter params={} too.
http://docs.gurtam.com/en/hosting/sdk/w … ort_tables
Then you can use Getting Rows and Getting Subrows requests to get report result.

Mobile Development
Gurtam
3

Getting table rows after exec_report

Re: Getting table rows after exec_report

thanks Kora, it worked

4

Getting table rows after exec_report

Re: Getting table rows after exec_report

ok, now I am pondering on how to get the table data. In my first message above , when running exec_report, I am getting the table columns, but not the data...
Running get_result_rows succeeded in executing and returning tons of results, but I dont see there the data, that is under exec_report columns.
I tried get_report_data, which returns below response:

[{"id":1,"n":"NAME","ct":"avl_unit","p":"","tbl":
            [{"n":"unit_stats","l":"Statistik","c":"","cl":"","s":"address_format","sl":"Address","p":"{\"address_format\": \"960495616_10_5\"}","sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0},"f":0}, {"n":"unit_events","l":"Ereignisse","c":"time,evt_text,location","cl":"Ereigniszeit,Ereignistext,Position","s":"","sl":"","p":"{\"event_mask\":\"*\"}","sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0},"f":0}]}]

where again I see my table columns names - Ereigniszeit,Ereignistext,Position, but cant seem to find my data beneath these columns.. Any ideas how to fetch the data?
thanks
Venelin

5

Getting table rows after exec_report

Re: Getting table rows after exec_report

ok, never mind - I got it.. After all it was wrong tableIndex being used in getting rows request.
For anyone who uses C# below might be of some use:

string reportTablesRows = "http://host/wialon/ajax.html?svc=report/get_result_rows&sid=" + eID +
                "&params={" +
                   "\"tableIndex\":0," +
                   "\"indexFrom\":1," +
                   "\"indexTo\":10," + // take Indexfrom and IndexTo as parameters from exec_report response
                   "}";

6

Getting table rows after exec_report

Re: Getting table rows after exec_report

i have the same problems i execute the report and it brings me emty array of results in Tables, Attachments and all i send the request to the server in this way in PHP
$speedParams=array ("reportResourceId"=>12947955,
                   "reportTemplateId"=>63,
                   "reportObjectId"=>15652870,
                   "reportObjectSecId"=>0,
                   "interval"=>array(
                           "from"=>1499148000,
                           "to"=>1499320740,
                           "flags"=>0 //0x00
                   ),
                   "tzOffset"=>-21600,
                   "lang"=>"en");

i execute the comand

$arregloReporteSPEED = $wialon_api->report_exec_report(json_encode($speedParams)."&sid=".$sid."");

and the response that i get from the gurtam server is:

{"reportResult":{"msgsRendered":0,"stats":[],"tables":[{"name":"unit_group_speedings","label":"Excesos de velocidad","grouping":{"type":"unit"},"flags":4352,"rows":22,"level":2,"columns":7,"header":["№","Grouping","Comienzo","Localización","Límite de velocidad","Velocidad máxima","Duración"],"header_type":["","","time_begin","location_begin","speed_limit","max_speed","duration"]}],"attachments":[]},"reportLayer":{"name":"report markers","bounds":[0,0,0,0]},"layerCount":1}

whit the msgsRendered in 0 and as you see, the array empty, Any ideas of what could be happening or what i'm doing wrong ?
I would be very grateful to get some help.

THANKS

7

Getting table rows after exec_report

Re: Getting table rows after exec_report

andres.apodaca
"msgsRendered":0 - is not important because its about map view in report
"rows":22,"level":2 - this information tells that you have 22 rows in report. To get them use report/select_result_rows request after executing report