Report System
The Report module generates periodic and on-demand reports from historical telemetry, alarm events, and operational metadata. Reports can be previewed in the browser, exported to multiple formats, and delivered on a schedule.
Interface Screenshot

Captured from the live Smart Site system with the English UI. See the
zh-CNcounterpart for the Chinese-UI screenshot.
1. Core Concepts
- Report Definition — A template describing layout, data sources, parameters, and output format
- Report Template — The reusable layout (headers, tables, charts) applied to a data query
- Data Source — Where the report data comes from (InfluxDB query, alarm history, device metadata)
- Scheduled Export — A cron-triggered job that renders and delivers a report
The engine is implemented in @ss-node/ss-report and exposed through the System → Reports page (route /system/reports).
2. Report Design
The report designer lets you build a report visually:
- Layout — define sections (header, body, footer) and place widgets (table, chart, KPI)
- Parameters — declare input parameters (date range, device filter, tag selection) that the user supplies at run time
- Bindings — bind each widget to a data source query
- Styling — apply theme colors via CSS variables (no hardcoded colors)
Reports are stored as JSON definitions in the project database, so they travel with the project when it is backed up or moved.
3. Data Source Configuration
Each widget in a report binds to a data source:
| Source Type | Description |
|---|---|
| InfluxDB Query | Time-series data for charts and trend tables |
| Alarm History | List of alarms within the parameter window |
| Device Metadata | Device and tag inventory |
| SQL (SQLite) | Project metadata tables for ad-hoc queries |
| Script Output | Run a script and use its return value as the dataset |
Parameters declared in the report are substituted into the query at run time, enabling dynamic filtering.
4. Scheduled Export
Reports can be exported automatically on a schedule:
- Open the report definition
- Navigate to the Schedule tab
- Set a cron expression (e.g.
0 8 * * *for daily at 08:00) - Choose an output format (PDF, Excel, CSV)
- Configure delivery — download to a folder, email attachment, or webhook upload
The scheduler uses @nestjs/schedule and records each run in the report execution log. Failed exports are retried with exponential backoff.
5. Report Templates
The system ships with starter templates:
- Daily Device Summary — per-device min/max/avg for key tags over 24h
- Alarm Log — all alarms raised in a period with acknowledge times
- Compliance Report — regulatory-style data rollup with header/footer
- Energy Consumption — hourly energy totals with bar chart
Templates can be customized and saved as new report definitions without overwriting the originals.
6. Report Preview
Before publishing or scheduling, preview the report:
- Open the report definition
- Click Preview
- Enter parameter values (or accept defaults)
- The backend renders the report and streams it back as HTML/PDF
- Adjust layout and re-preview until satisfied
Preview uses the same rendering pipeline as the final export, so what you see is what you get.
7. Operational Guidance
7.1 Improving Report Performance
- Bound the time range — unbounded InfluxDB queries are slow
- Use aggregation (mean/max) instead of raw points for long ranges
- Avoid thousands of rows in a single table widget — paginate or summarize
- Schedule heavy reports off-peak
7.2 Delivering via Email
- Configure SMTP in System → Settings → Notification
- In the report schedule, select Email delivery
- Enter recipient addresses (comma-separated)
- The export is attached as a PDF/XLSX and sent on each run
8. FAQ
Q: A scheduled report did not run. A: Check the report execution log for errors. Verify the cron expression and that the scheduler module is loaded. Confirm that any parameters with defaults are set, since the scheduled run cannot prompt for input.
Q: The PDF export looks different from the preview. A: PDF rendering depends on the headless browser / print engine. Ensure charts have explicit dimensions and that fonts are available on the server. Avoid CSS features unsupported by the print engine.
Q: How do I add a chart to a report? A: In the designer, drag a Chart widget into a section, bind it to an InfluxDB data source, and map the returned columns to X and Y axes. Preview to verify.
Q: Can reports access data across projects? A: No. Reports run in the context of the active project and its InfluxDB bucket. For cross-project rollups, create a dedicated project that aggregates data via scripts or external ETL.
9. Related Links
../../07-storage/README.md../../10-script/README.md../../06-alarm/README.md- Report Package