use of org.netxms.client.reporting.ReportResult in project netxms by netxms.
the class NXCSession method listReportResults.
/**
* List report results
*
* @param reportId The report UUID
* @return List of ReportResult objects
* @throws IOException if socket I/O error occurs
* @throws NXCException if NetXMS server returns an error or operation was timed out
*/
public List<ReportResult> listReportResults(UUID reportId) throws NXCException, IOException {
final NXCPMessage msg = newMessage(NXCPCodes.CMD_RS_LIST_RESULTS);
msg.setField(NXCPCodes.VID_REPORT_DEFINITION, reportId);
sendMessage(msg);
NXCPMessage response = waitForRCC(msg.getMessageId());
List<ReportResult> results = new ArrayList<ReportResult>();
int count = response.getFieldAsInt32(NXCPCodes.VID_NUM_ITEMS);
long base = NXCPCodes.VID_ROW_DATA_BASE;
for (int i = 0; i < count; i++, base += 10) {
ReportResult result = ReportResult.createFromMessage(response, base);
results.add(result);
}
return results;
}
use of org.netxms.client.reporting.ReportResult in project netxms by netxms.
the class ReportExecutionForm method renderSelectedResult.
/**
* Render currently selected report result
*
* @param format rendering format
*/
private void renderSelectedResult(ReportRenderFormat format) {
IStructuredSelection selection = (IStructuredSelection) resultList.getSelection();
if (selection.size() != 1)
return;
ReportResult r = (ReportResult) selection.getFirstElement();
renderReport(r.getJobId(), r.getExecutionTime(), format);
}
Aggregations