Skip to content

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.

The report is split in two on purpose, and the split is the point:

HalfWhere it runsWhat it does
DatasourceOn the serverPrepares the data and returns it
HTML · CSS · JSIn the browserPresentation 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.

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.

Four values are already there for the script:

BindingTypeDescription
startDate · endDateEpoch millisecondsThe range the report covers
isAutoBooleantrue on a scheduled run, false when run by hand
langTextThe 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 averages
var 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.

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;
FieldDescription
Name · DescriptionName and description
HTML · CSS · JSPresentation; up to 1 MB each
DatasourceThe data script
Period · Report timeAs on a pivot report — Hourly, Monthly, Minutes
Print · MailSeparate 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.