Search in sources :

Example 1 with ReportResult

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;
}
Also used : NXCPMessage(org.netxms.base.NXCPMessage) ArrayList(java.util.ArrayList) ReportResult(org.netxms.client.reporting.ReportResult) ConnectionPoint(org.netxms.client.topology.ConnectionPoint) AccessPoint(org.netxms.client.objects.AccessPoint)

Example 2 with ReportResult

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);
}
Also used : IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ReportResult(org.netxms.client.reporting.ReportResult)

Aggregations

ReportResult (org.netxms.client.reporting.ReportResult)2 ArrayList (java.util.ArrayList)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 NXCPMessage (org.netxms.base.NXCPMessage)1 AccessPoint (org.netxms.client.objects.AccessPoint)1 ConnectionPoint (org.netxms.client.topology.ConnectionPoint)1