Report diagnosis

To obtain diagnostic information from the Reporting Extension, the "TcHmiReporting.Diagnostics" symbol can be queried. This contains information about the reports in process "TcHmiReporting.Diagnostics::reportsInProgress" and about the connection status of the runtimes "TcHmiReporting.Diagnostics::runtimes" (Reporting Server).

If further information is required, e.g. if a report has been successfully created, this cannot be queried directly.

Queries:

Result reporting creation:

To check whether a report has been successfully created, the Reporting Extension creates a new entry in the TcHmi server log. This entry can be evaluated with registerConsumer.

Sample:

TcHmi.Server.Events.registerConsumer(reportingEventFilter, {
    list: (events) => {
        // read list on beginning (old messages)
        console.log(events);
    },
    subscription: (event) => {
        // subscribe to new events
        if (event.error !== TcHmi.Errors.NONE) {
            return;
        }
        // check for message state. Identify reports with error
        if (event.event?.name === "reportCreatedMsg") {
            // succes
            console.log(event.event.text);
        } else if (event.event?.name === "reportGenerationFailedMsg") {
            // error
            console.log(event.event.text);
        }
        console.log(listOfReports);
    }
});