Topic: get_result_rows node.js error 5
Hello, I need to get the reports with their respective data. I am working with node.js.
After reading, making tests and errors, I managed to obtain the answers, but not their data.
I will tell you the steps I have followed to achieve this.
1.- I look for the id of the vehicles by their name with the function core/search_items.
2.- I look for the id of the reports and the id of the template with the function core/search_items.
3.- I look for the reports with the function report/exec_report.
Here is my problem, it does not show me the data of the vehicles of those reports.
I read that I should execute the function report/get_result_rows, but it does not work for me, it generates error 5.
I'm confundant with the table index.
The result that I generate report/exec_reportd:
{ reportResult:
{ msgsRendered: 1,
stats: [],
tables: [ [Object], [Object], [Object] ],
attachments: [] },
reportLayer:
{ name: 'report unit_msgs',
bounds: [ -33.5327339172, -70.8768463135, -33.4696273804, -70.7319946289 ],
units: [ [Object] ] },
The code of the function report/get_result_rows
function resultRows () {
var params = {
"tableIndex":0,
"indexFrom":0,
"indexTo":0
};
request.post({
url: URL + 'svc=report/get_result_rows',
json: true,
form: {
sid: SID,
params: JSON.stringify(params)
}
}, function (error, response, body) {
console.log(body);
});
}
Note: I occupy report/get_result_rows because all the tables are level 1.