Skip to content

Report Template

Menu path: Model Management → Report Template. Report templates define the generation logic and configuration for PDF or Excel files and can be reused by RPCs that output reports. View generated records under Log Management → Report Records.

Create and Configure

FieldRequirement and purpose
CodeRequired. Identifies the template and is entered separately from its display name.
NameRequired. Displayed in the template list.
Template TypeRequired. Supports PDF and Excel; initially set to PDF for a new template.
RemarksOptional. Describes the purpose of the report.
Change DescriptionOptional. Records what changed and why.
Configuration Parameters (config)The template's JSON configuration, such as titles, chart titles, or worksheet names.
Example Input (input)JSON sample data for the editor preview, such as a device name and data rows.

The editor provides Configuration, JSON Configuration, and Preview tabs. The list supports filtering by code, name, and template type, and provides import and export actions. The system platform also provides report template management, with an additional Organization field. Check whether you are configuring a tenant-level or system-level template.

Preview Data and Actual Calls

Reports run on the server. Expand the available-parameter reference in the editor to inspect inputs, tools, and execution limits.

VariableActual report generationEditor preview
configTemplate configuration; an RPC can override individual keys through dnMsg.data.config.Uses the configuration parameter editor contents.
inputData for this call, passed by the RPC through dnMsg.data.input.Uses the example input editor contents.
deviceContext of the device that triggered the report.Empty object {}.
paramsInput parameters for this RPC call.Empty object {}.
org_paramsCurrent organization parameters.Uses the same organization parameter source as actual calls.
metaInformation about the template, generation time, device, RPC, trigger source, and operator.meta.preview is true; device and RPC fields are empty.

Actual calls do not fall back to the example input. If the RPC does not pass input, the template receives an empty object. Data in the preview does not prove that an actual call supplies data. Templates that depend on device or params must also handle empty preview context.

meta includes preview, generate_time, tenant_code, template_id, template_code, template_name, template_type, eui, rpc_id, rpc_method, source_type, operator_id, and operator_name. generate_time is an ISO 8601 timestamp string.

Tools and Execution Limits

Tool or limitDescription
ctxProvides report utilities including chart(option), formatDate, formatNumber, and escape. Escape external text before including it in HTML.
axios, fetchRetrieve data from external systems. Each HTTP request is limited to 15 seconds. For HTTP 404/500 responses, check resp.ok when using fetch; do not rely only on exceptions.
dayjs, Buffer, consoleDate handling, restricted binary processing, and server-side logging.
setTimeout / clearTimeoutAvailable; setInterval is unavailable.
AbortController / AbortSignalCan cancel HTTP requests or shorten the wait.
Promise waitThe page documents a 25-second limit for new Promise / Promise.all.
Overall executionThe entire template is limited to 30 seconds. Multiple slow sequential requests may reach the overall timeout first.
Unavailable environmentNo window, document, require, or setInterval.

Preview uses the server-side report runtime, including real organization parameters and HTTP tools. Check whether the template accesses external services before previewing it. Opening the page or saving configuration does not verify data retrieval or report generation.

Troubleshooting Order

  1. Check the template type, code, and template selected by the actual call.
  2. Check the actual input and config, rather than only the preview sample.
  3. Check the required device context, organization parameters, and external data retrieval results.
  4. Check for timeouts and APIs unsupported by the runtime.
  5. In Report Records, confirm the generated record, file type, storage method, and time.