Topic: Using getRowDetail() to get multilevel rows of report result with Java
Hi,
I am trying to execute a custom report using JavaScript API. But getTableRows() function only returns the outer most rows of the multilevel result table. I tried using getRowDetail() as described in the JS API document, but it always returns an error. can anyone guide me on this or suggest any alternative to achieve my result.
I am attaching the code snippet.
thanks in advance.
result.getTableRows(i, 0, tables[i].rows, // get Table rows
qx.lang.Function.bind( function(html, code, rows) { // getTableRows callback
if (code) {alert(wialon.core.Errors.getErrorText(code)); return;} // exit if error code
var z=0;
for(var j in rows) { // cycle on table rows
result.getRowDetail(i,z,qx.lang.Function.bind(function( code, cols) {
if (code) {alert(wialon.core.Errors.getErrorText(code)); return;}
console.log(cols);
}));
z++;
if (typeof rows[j].c == "undefined") continue; // skip empty rows
html += "<tr"+(j%2==1?" class='odd' ":"")+">"; // open table row
for (var k = 0; k < rows[j].c.length; k++) // add ceils to table
html += "<td>" + getTableValue(rows[j].c[k]) + "</td>";
html += "</tr>";// close table row
}
html += "</tbody></table>";
msg(html +"</div>");
var d = new Date();
var month = d.getMonth();
var day = d.getDate();
var output =((''+day).length<2 ? '0' : '') + day + '/' +
((''+month).length<2 ? '0' : '') + month + '/' +d.getFullYear();
var time = d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds();
//alert(month);
var outputt =+day+'-'+((''+month).length<2 ? '0' : '')+month+'-'+d.getFullYear()+' '+time;
}, this, html)
);