HTML Report
An HTML report is the family where you write the page yourself. A pivot report is built by configuring the table; here you decide the layout, the formatting and how the figures are presented.
Two halves
Section titled “Two halves”The report is split in two on purpose, and the split is the point:
| Half | Where it runs | What it does |
|---|---|---|
| Datasource | On the server | Prepares the data and returns it |
| HTML · CSS · JS | In the browser | Presentation only; receives the data ready-made |
The datasource is a script and reaches the platform’s ins API. The page itself never calls back into the application — by the time the document starts rendering, the data is already embedded in it.
Whose access the data is read under
Section titled “Whose access the data is read under”The datasource reaches the ins API under the access of whoever triggered the render: the person looking at a preview, or the space’s automation identity on a scheduled run. Not the author’s, and not the owner’s.
That shows itself in addressed delivery: the report is produced separately for recipients with different row access, so each gets the data they are entitled to see.
The datasource script
Section titled “The datasource script”Four values are already there for the script:
| Binding | Type | Description |
|---|---|---|
startDate · endDate | Epoch milliseconds | The range the report covers |
isAuto | Boolean | true on a scheduled run, false when run by hand |
lang | Text | The language chosen for the report; empty when none was given |
What you return can be any shape you like — nothing downstream inspects it, it is carried to the page as it is.
// Datasource: prepare the slice's hourly averagesvar rows = ins.getLoggedHourlyVariableValueStats( ['Temperature_C'], ins.getDate(startDate), ins.getDate(endDate));return { title: 'Temperature summary', automatic: isAuto, rows: rows };The script runs on the server, so the script engine’s rules apply here too — the syntax, the limits and the ins.* signatures.
How the data reaches the page
Section titled “How the data reaches the page”What the datasource returns is embedded in the document as window.__reportData. The page’s JavaScript reads it directly:
var d = window.__reportData;document.getElementById('title').textContent = d.title;Fields and scheduling
Section titled “Fields and scheduling”| Field | Description |
|---|---|
| Name · Description | Name and description |
| HTML · CSS · JS | Presentation; up to 1 MB each |
| Datasource | The data script |
| Period · Report time | As on a pivot report — Hourly, Monthly, Minutes |
| Print · Mail | Separate day and time for printing and mail, each turned on independently |
Scheduling, printing, mail and the output formats all work as they do on a pivot report, including the rule that recipients come from the report’s own Mail To field. Detail: Pivot Report.
The output is HTML and PDF, the PDF printed by a headless browser on the server.
Related
Section titled “Related”- HTML Report Editor — the screen where this report is written
- Pivot Report — the other family, built by configuration
- Script Engine — the rules the datasource follows