The reports-run-now-xml function enables you to run a specific report in real-time, immediately receiving the information that the report provides and waiting until the report is finished before you proceed. This is very similar to the reports-system-reporting function, except that the reports-run-now-xml function enables you to run an existing report rather than simply retrieving all report entries of a specified type.
Note: Because this function creates the specified report in real-time and is not using the report-service, manually running a report with this function can take a long time for large reports. In most cases, you should use the
reports-enqueue function to create reports, so that they can be created asynchronously by the reporting service without directly impeding the execution of your application.
The parameters to the reports-run-now-xml function (ReportsRunNowXml in the SOAP API) are the following:
- report (string) - the internal name of the report that was previously enqueued and for which you want to retrieve results.
- id (string) - an arbitrary name that you specified to be used as an identifier for this report when it was enqueued.
- start (dateTime) - the start date (and, optionally, time) for which you want to see report entries. This variable must be represented in standard date/time format (CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm).
- end (dateTime) - the ending date (and, optionally, time) for which you want to see report entries. This variable must be represented in standard date/time format (CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm).
- database (string) - Optional the name of the particular database that you specified when you enqueued the report.
The following is an example of a call to the SOAP API version of the reports-run-now-xml function in C#:
ReportsRunNowXml rrnx = new ReportsRunNowXml();
rrnx.report = "system-errors";
rrnx.id = "errors";
rrnx.maxitems = 1000;
rrnx.start = new DateTime(2009, 9, 11, 0, 0, 0, System.DateTimeKind.Local);
rrnx.end = new DateTime(2009, 9, 25, 0, 0, 0, System.DateTimeKind.Local);
XmlElement reportxml = port.ReportsRunNowXml(rrnx);
Once this call returns the XML elements that comprise your report, your application can parse and use the reporting information however you'd like.