HTTP query envelopes
Information Query returns an envelope:ok, even after HTTP success. Failed queries can include errorText, errorType, errorCode, and ErrorElement.
XML is represented as JSON using these conventions:
Normalize absent, single, and repeated elements before iteration:
GetReports helper reduces the matching report nodes to a string array.
The raw HTTP envelope is not itself that array.
Parameter forms
Parameter retrieval returns an XMPP data form inStanza.x. The JavaScript helper returns that form directly.
Illustrative form, with XML metadata omitted:
Honor any validation information in the form. Do not assume every report accepts dates, the same date format, or the same field names.
Preserve hidden fields. Fixed fields describe the form rather than requesting user input.
An actual empty form can be submitted with no fields; a missing form should be investigated.
Assembled JavaScript results
ExecuteReport returns a completed query record assembled from progress events.
This illustrative result contains one section and one table. A report can contain multiple tables, nested sections, and generated objects.
Section
Items can contain nested sections, tables, objects, and messages.
A table can appear in a section and in Tables; these are two ways to access the same output, not two separate tables.
Messages have Type: "Message", Level, and Text. Inspect their levels and text; they are not all copied into Errors.
The helper removes Status when the query ends. Do not require it in a completed result.
An HTTP execution acknowledgment never contains this assembled object.
Read tables and cells
Columns defines display order. Each entry in Records is a row array in that same order:
Records[rowIndex][columnIndex] belongs to Columns[columnIndex].
Columns contain Id and may include Header, SourceId, Partition, ForegroundColor, BackgroundColor, Alignment, and NrDecimals.
Do not assume a particular table ID, column count, or column name unless your provider defines that contract for your report.
For raw
newRecords progress, cells retain their XML names, such as string, double, quantity, or measurement.
Read record.__ordered when present; grouping by cell type would scramble column order.
For quantities and measurements, the raw attributes are m (magnitude), u (unit), and e (measurement error).
Convert values according to the report’s contract. Avoid converting large integers to JavaScript numbers if precision matters.
Render labels and text as text. Decode objects according to an allowed content type rather than inserting arbitrary output as HTML.
Handle partial or failed results
- Reject HTTP failures and Information Query responses with
ok: falsebefore consuming success data. - Wait for query completion, not just the first table or its
Doneflag. - Treat aborted queries, missing progress, and client deadlines as incomplete results.
- Inspect helper
HasErrors,Errors, and section messages before displaying a result as successful.