Report metadata — grouped, filtered data
Analytics reports as metadata — the four report shapes, dataset binding, drill-through, and how a report differs from a list view and a dashboard widget
A Report is an analytics artifact. It groups and aggregates the rows of a dataset into a pivot — grouped down-axis rows, optionally pivoted across a second axis, with measures in the cells — and gives that pivot its own page in the app.
Three surfaces in this module look similar from a distance and are not interchangeable. Pick by what the reader is looking at:
| A report shows | Bound to | Authored in | Reached at | |
|---|---|---|---|---|
| List view | individual records, one row each | an object | that object's views | the object's nav entry |
| Dashboard widget | one aggregate slice, sized into a tile grid | a dataset | a dashboard's widgets[] | inside its dashboard |
| Report | a whole pivot — grouped rows, optional across-axis columns, aggregated cells, an optional chart, drill-through to the records | a dataset | defineStack({ reports }) | its own nav entry and URL |
The line between the first and the third is the one that actually gets crossed. A flat
list of records is an object-bound row lens (ADR-0017), not analytics — so it belongs
in a view, whatever it is called. The showcase package made exactly that move: its former
TaskListReport is now the tabular list view on showcase_task, because a report that
never aggregated anything was a view wearing the wrong kind.
The line between the second and the third is scale, not capability: a widget is one slice sized into a dashboard's grid, a report is the full grid with its own page. Both bind datasets the same way, so the numbers agree by construction.
A report binds a dataset — and only a dataset
There is one data path, not two. Under the ADR-0021 single-form cutover a report
is dataset-bound, full stop. The legacy inline query — objectName plus columns plus
groupings on the report itself — was removed in that cutover, so there is no
object-bound report to choose between. Writing objectName, object, source or
dataSet is rejected at authoring time with a pointer at dataset.
Every report except a joined one must declare dataset and a non-empty values;
the schema refuses it otherwise, with the message a report needs dataset + values
(measure names). A joined report carries its data on blocks[] instead and must declare at
least one block.
The dataset owns the base object, the joins, and the named dimensions and measures. That
is what keeps a number identical across every report, widget and dashboard that selects
it. Dataset authoring — declaring dimensions and measures, and what rows / values /
runtimeFilter select from them — is covered once, from the dataset side, in
Analytics & Datasets. This page covers the report shape
on top of it.
The four report types
type defaults to tabular.
type | Renders | Needs |
|---|---|---|
tabular | the dataset's rows as a flat table | dataset + values |
summary | rows grouped down one or more dimensions, measures aggregated per group | dataset + values, and rows to group by |
matrix | a true pivot: rows down × columns across, measures in the cells | dataset + values + rows + columns |
joined | several independent sub-reports stacked in one page | blocks[] (each block dataset-bound) |
Summary — grouped totals
import { defineReport } from '@objectstack/spec/ui';
export const HoursByStatusReport = defineReport({
name: 'showcase_hours_by_status',
label: 'Hours by Status',
description: 'Estimated hours grouped by task status.',
type: 'summary',
dataset: 'showcase_task_metrics',
rows: ['status'], // dimension names, down the page
values: ['est_hours'], // measure names, aggregated per group
});Matrix — a cross-tab
columns is the across-axis and is read only by a matrix report; other types ignore it.
import { defineReport } from '@objectstack/spec/ui';
export const StatusPriorityMatrixReport = defineReport({
name: 'showcase_status_priority_matrix',
label: 'Status × Priority',
type: 'matrix',
dataset: 'showcase_task_metrics',
rows: ['status'], // down axis
columns: ['priority'], // across axis
values: ['est_hours'], // in the cells
});Joined — several sub-reports in one page
Each block is independently queried and stacked in the container. Use it for comparative panels over one domain — "open / completed", "new / qualified / closed" — where each panel is a different slice rather than a different subject.
A block is a sub-report, so it takes the same dataset / rows / columns / values /
runtimeFilter / order vocabulary, and each block is drawn as a table. Three keys are
container-level only and are rejected on a block: nested blocks (no recursion — a
block's type enum excludes joined), drilldown and protection.
The container selects nothing itself, so a joined report refuses every top-level key that
selects or orders data and points it onto blocks[]: dataset, and a non-empty rows,
columns, values or order. The container keys a joined report does read are
runtimeFilter (ANDed into every block's own) and drilldown.
A joined report draws no chart. chart on the container is refused with a joined
report draws no chart — it draws each block as a table and never reads chart, on the
container or on a block, and blocks[].chart was removed in @objectstack/spec 17.5.0:
nothing ever drew either one. To plot one of these slices, give it a report of its own with
a chart.
import { defineReport } from '@objectstack/spec/ui';
export const TaskOverviewReport = defineReport({
name: 'showcase_task_overview',
label: 'Task Overview',
type: 'joined',
blocks: [
{
name: 'open_block',
label: 'Open Tasks',
type: 'summary',
dataset: 'showcase_task_metrics',
rows: ['status'],
values: ['est_hours'],
runtimeFilter: { done: false },
},
{
name: 'done_block',
label: 'Completed Tasks',
type: 'summary',
dataset: 'showcase_task_metrics',
rows: ['status'],
values: ['task_count'],
runtimeFilter: { done: true },
},
],
});Ordering
order is a list of sort keys, most significant first — an array rather than a map,
because the key order is the sort significance and JSON object key order is not a contract
you should have to lean on. Each key is { by, direction }, direction defaulting to
asc.
Two rules are enforced when the report is authored, not discovered when it renders:
bymust name something this report selects — arows/columnsdimension or avaluesmeasure. Anything else is an authoring error rather than an ordering that silently does nothing.- A
joinedreport orders per block.orderon the container is rejected with ajoinedreport orders per block — moveorderontoblocks[].
Ordering is optional: a selected date dimension already comes back chronological. What
order is for — sorting by a measure, reversing a time axis, ordering a non-time
dimension — and how it is applied server-side over the whole grid is covered in
Analytics & Datasets, which this page does not repeat.
Drill-through
drilldown is a boolean, on by default (ADR-0021 D2). It turns click-through from an
aggregated row or cell to the underlying records on or off for a summary / matrix
report; the host resolves the dataset's object and its dimension-to-field mapping.
drillDown — camelCase — is a different capability on a different surface: it is the
react-tier <ObjectChart drillDown={…}> prop, a configuration object that configures a
chart segment drill. The report key is drilldown, all lowercase, and a plain boolean.
The two are one character apart, so a rename suggestion would walk you straight into a
second rejection — write drilldown: true / false if you mean the report.
An embedded chart
A non-joined report may carry one chart (a joined report refuses it — see above). Its
xAxis and yAxis name the bound dataset's dimension and measure — not raw object
fields — and are plotted from a second dataset query, so the chart and the grid cannot
disagree.
import { defineReport } from '@objectstack/spec/ui';
export const HoursByStatusChartReport = defineReport({
name: 'showcase_hours_by_status_chart',
label: 'Hours by Status (Chart)',
type: 'summary',
dataset: 'showcase_task_metrics',
rows: ['status'],
values: ['est_hours'],
chart: {
type: 'bar',
xAxis: 'status', // a dataset DIMENSION
yAxis: 'est_hours', // a dataset MEASURE
},
});Period and export
A non-joined report can declare the period it covers and how its table is downloaded.
Both keys are optional: a report that declares neither shows every period, as it always
has.
import { defineReport } from '@objectstack/spec/ui';
export const PipelineByQuarterReport = defineReport({
name: 'pipeline_by_quarter',
label: 'Pipeline by Quarter',
type: 'summary',
dataset: 'opportunity_metrics',
rows: ['stage'],
values: ['amount_sum'],
dateRange: { dimension: 'close_date', defaultRange: 'this_quarter' },
exportOptions: { formats: ['csv', 'xlsx'], fileNamePrefix: 'pipeline' },
});dateRange is a window over one date dimension of the dataset. defaultRange and
allowCustomRange are the dashboard's own: the same preset names (this_month by default,
this_quarter, last_30_days, …, and custom to open the picker with no preset) and the
same custom-range switch, on by default.
dimensionnames a dataset dimension that declarestype: 'date'— a dimension, not a raw object field. A dimension carries its own relationship path, so a date on a related record works the same way.- Leave
dimensionout only when the dataset declares exactly onetype: 'date'dimension. A dataset with none, or with two or more (a task dataset withdue_dateandcompleted_date, say), is an error that names what it found. So is adimensionthe dataset does not declare, or one that is nottype: 'date'.os validateandos buildcheck this against the dataset, and so does publishing the report. - The window is a filter, not a bucket. It is applied with the report's
runtimeFilterand the dataset's own filter. How rows are grouped by date stays with the dimension'sdateGranularityand the report'srows/columns. - Compare with the previous period is a switch beside the period chip, not a report key.
Like the chip's own pick, it belongs to the viewer and is not saved. While it is on and the
period names a window, the chart is compared with the same-length window just before it
(
compareTo: { kind: 'previousPeriod' }on the window's dimension): a bar or line chart draws the earlier window as a muted series, and a single number shows the previous value and the change under it. All time names no window, so nothing is compared. - Where it is offered: a chart that can draw a second series (
bar,column,horizontal-bar,line,area) over a category axis, or a single number (metric,kpi). It is not offered on aseriesBysplit, nor on a chart whose x axis is the window's own date dimension: there the earlier window's date buckets would not line up with the current ones.
exportOptions uses the list export's key and member names: formats,
includeHeaders, fileNamePrefix. A report table downloads as csv or xlsx. Export is on
by default (both formats), and formats: [] turns it off. The download is the table as drawn,
within the active period and filter, and the file is named for the report label (or
fileNamePrefix) and the period. maxRecords and streaming are list-only, because a report's
rows are already aggregated.
Who may export is not a report key. The export control is offered to a viewer whose
permissions allow export of the dataset's base object. That is the permission-set
allowExport axis the list toolbar uses (see Permissions and protection).
On the Console report page, a report that declares dateRange draws a period chip above the
report, and every query the report makes runs inside the chosen window. The Export control is
drawn once the table has rows.
What is deliberately not offered: a joined report refuses both keys, because its blocks
may bind different datasets and it draws one table per block. A report has no subscription or
scheduled delivery, and no pdf or json export.
Making a report reachable
A report is not reachable because it exists. Give it a navigation entry on an app:
import { defineApp } from '@objectstack/spec/ui';
export const AnalyticsApp = defineApp({
name: 'showcase_analytics',
label: 'Analytics',
navigation: [
{
id: 'nav_hours_by_status',
type: 'report',
reportName: 'showcase_hours_by_status',
label: 'Hours by Status',
icon: 'chart-bar',
},
],
});reportName is cross-checked against the stack: an app navigating to a report the
stack does not define fails validation with App '<app>' navigation references report '<name>' which is not defined in reports. (The check is skipped for a stack that declares
no reports at all, where the target may come from another package.) The entry resolves to
/report/<reportName> in the console.
A report entry without reportName opens the app's report index
(/apps/<app>/reports), which lists every report the app ships that the member may
open. The console adds no index entry by itself: declare { id: 'nav_reports', type: 'report' } where the menu should carry it.
Editing a report beside it
An admin opens a report's Edit panel from the report page (and the same panel in Studio). The panel speaks the reader's language rather than the schema's:
- Data source is the bound
dataset, shown by its label; Metrics are itsvalues, each read asLABEL · AGGREGATE(Amount · Sum); Group by is itsrows; a matrix adds Group columns by (columns). Fields show their labels; the machine name is on hover only. - The chart type list shows each type by name with its icon.
- The name box shows the report's name in the current language. An edit made in a
non-default language is stored for that language only, as the inline locale map
{ default: SOURCE, 'zh-CN': EDIT }, so every other language reads what it read before. For a report installed from a package, the server serves that entry ahead of the package's translation bundle; a report with no packaged base keeps the bundle first, so where the bundle has an entry for that language the edit does not show (inline locale maps). - The page heading and subtitle stay in the current language while the panel is open; a key the edit changes shows the edit.
Permissions and protection
The report schema carries exactly one access-shaped block, and it is not about viewers:
protection— the ADR-0010 package-author lock policy, declared once on the report (never per block). The loader translates it into the runtime protection envelope at registration time. It governs what an installing org may modify, not who may read the numbers.
There is deliberately no viewer-permission key on a report. Who may see what comes from the two layers underneath it: row- and tenant-level security is enforced by the runtime per joined object when the dataset is queried — never declared on the dataset and never on the report — and reachability comes from the app navigation entry and the permissions on the app that carries it. A report is a presentation over a dataset, so it inherits the dataset's enforcement rather than restating it.
Export follows the same principle. A report declares what its export offers
(exportOptions), never who may use it: that is the permission-set allowExport grant on
the dataset's base object, which also governs exporting that object's list views.
Where the numbers come from
The renderer posts one dataset selection — dimensions, measures, and optionally
runtimeFilter, totals and order — through dataSource.queryDataset. That
is the same governed path dataset-bound dashboard widgets and the dataset
preview use, which is why a number shown in a report matches the same number
shown on a dashboard.
Presentation follows from what the server returns: column headers use the dataset's server-supplied display label, and measure cells are formatted with the field's declared currency and numeral format rather than the raw measure name.
Stored pre-9.0 documents — migration only
Not an authoring option
This section is about documents that already exist in storage. The shape it describes is not available for authoring. Everything above is how a report is written; nothing below is.
Before the ADR-0021 cutover a report carried its own query: an objectName,
columns as column definition objects with aggregate, and
groupingsDown / groupingsAcross with sortOrder and dateGranularity.
That form is rejected by the current schema — objectName and
groupingsDown come back as unrecognized keys, and object-shaped columns
fails as the wrong type.
Stored documents in that shape still render, through a deliberately lossy bridge: the dispatcher converts them to a presentation-layer report and hands them to the viewer. The conversion reads the current keys, so a pre-9.0 document arrives with none of them — what it produces is the report's title and an empty column set. The document renders; its columns, groupings, aggregates and sort do not. There is no diagnostic, which is exactly why the bridge is a waiting room and not a supported way to write a report.
Migrating one is a re-expression against the dataset:
| Pre-9.0 key | Where it goes now |
|---|---|
objectName | Gone from the report — the dataset owns the object. |
columns: [{ field, aggregate }] | values: string[]; the aggregate becomes a measure in the dataset. |
columns: [{ field }] (non-aggregated) | rows: string[], as a dimension. |
groupingsDown: [{ field }] | rows: string[]. |
groupingsAcross: [{ field }] | columns: string[]. |
sortOrder on a grouping | order: [{ by, direction }] on the report. |
dateGranularity on a grouping | A time dimension declared at that grain in the dataset. |
filter | runtimeFilter. |
The work that has no mechanical equivalent is the dataset itself: measures and time dimensions the old report declared inline have to exist in the semantic layer before the migrated report can name them.
Filter-time date helpers — current limitation
The server does not currently evaluate cel`...` expressions embedded
inside filter values; the unevaluated template object reaches the driver.
Compute concrete ISO date strings instead and treat the report as a snapshot:
// Module-load helper. Re-evaluates each time the app boots.
const daysAgo = (n: number): string => {
const d = new Date();
d.setUTCDate(d.getUTCDate() - n);
return d.toISOString().slice(0, 10); // 'YYYY-MM-DD'
};
runtimeFilter: { last_activity_date: { $lt: daysAgo(60) } }For a sliding window, recompute on each render or key a useMemo on a one-hour
bucket. Native filter-time CEL evaluation is tracked for a future major version.
Related
- Schema reference: Report — the full generated property
tables for
Report,JoinedReportBlock,ReportChartandReportSort. - Analytics & Datasets — declaring the dataset a report binds, and the ordering and filter-placeholder semantics shared with dashboards.
- Dashboard Metadata — the same dataset binding, sized into a tile grid.
- View Metadata — the object-bound row lens a flat record list belongs in.
- App Metadata — navigation entries, including
type: 'report'.