Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .changeset/27975-summary-report-subtotals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
'@object-ui/plugin-report': patch
'@object-ui/i18n': patch
---

feat(plugin-report): a summary report with two or more `rows` levels draws a subtotal per outer group, and no longer repeats the outer value on every row

Clause-②: no
Metadata-protocol: none

**Visible change on existing reports.** Every dataset-bound `summary` report whose `rows` names two or more dimensions now renders grouped on its next render, with nothing for the author to change:

- Each outer group draws a header row naming its value once, then its inner rows with the outer column left blank, then a `Subtotal` row. With three or more levels the groups nest, one header and one subtotal per level above the innermost.
- The subtotals are the server's. The report asks the dataset for every proper prefix of `rows` through `totals.groupings` (`[[owner], []]` for `rows: [owner, stage]`), the way a `matrix` already asks for its row and column totals. They are never summed in the browser, so an `avg` or a distinct count subtotals correctly.
- Groups keep the order their first row arrives in: the declared option order of a select dimension, or the report's own `order`. Rows of one group that an `order` by a measure brings back apart are drawn together under it.
- Clicking a subtotal row drills into the whole group, scoped by the outer dimensions only. Clicking an inner row drills by every dimension, as before.
- The export (CSV and XLSX) writes the grouped table as drawn.

Unchanged: a one-level `summary` (grand-total footer only), a `tabular` report, and a `matrix`, including a matrix without `columns`. A server that does not answer the prefix groupings gets the plain table, with the outer value repeated and no subtotal rows.

`@object-ui/i18n` adds `report.subtotal` to every pack.
1 change: 1 addition & 0 deletions ui/packages/i18n/src/locales/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3569,6 +3569,7 @@ const ar = {
report: {
total: "الإجمالي",
totals: "الإجماليات",
subtotal: "المجموع الفرعي",
loading: "جارٍ التحميل…",
forbiddenMessage: "ليست لديك صلاحية لعرض البيانات الخاصة بهذا التقرير.",
dateRange: {
Expand Down
1 change: 1 addition & 0 deletions ui/packages/i18n/src/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3304,6 +3304,7 @@ const de = {
report: {
total: "Gesamt",
totals: "Summen",
subtotal: "Zwischensumme",
loading: "Wird geladen…",
forbiddenMessage: "Sie haben keine Berechtigung, die Daten dieses Berichts anzuzeigen.",
dateRange: {
Expand Down
1 change: 1 addition & 0 deletions ui/packages/i18n/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1781,6 +1781,7 @@ const en = {
report: {
total: 'Total',
totals: 'Totals',
subtotal: 'Subtotal',
loading: 'Loading…',
// objectui#12330 — the report's no-access state; its title is `dashboard.widgetForbiddenTitle`.
forbiddenMessage: 'You don’t have permission to view the data behind this report.',
Expand Down
1 change: 1 addition & 0 deletions ui/packages/i18n/src/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3371,6 +3371,7 @@ const es = {
report: {
total: "Total",
totals: "Totales",
subtotal: "Subtotal",
loading: "Cargando…",
forbiddenMessage: "No tienes permiso para ver los datos de este informe.",
dateRange: {
Expand Down
1 change: 1 addition & 0 deletions ui/packages/i18n/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3367,6 +3367,7 @@ const fr = {
report: {
total: "Total",
totals: "Totaux",
subtotal: "Sous-total",
loading: "Chargement…",
forbiddenMessage: "Vous n’avez pas l’autorisation de voir les données de ce rapport.",
dateRange: {
Expand Down
1 change: 1 addition & 0 deletions ui/packages/i18n/src/locales/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3306,6 +3306,7 @@ const ja = {
report: {
total: "合計",
totals: "合計",
subtotal: "小計",
loading: "読み込み中…",
forbiddenMessage: "このレポートのデータを表示する権限がありません。",
dateRange: {
Expand Down
1 change: 1 addition & 0 deletions ui/packages/i18n/src/locales/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3303,6 +3303,7 @@ const ko = {
report: {
total: "합계",
totals: "합계",
subtotal: "소계",
loading: "로딩 중…",
forbiddenMessage: "이 보고서의 데이터를 볼 수 있는 권한이 없습니다.",
dateRange: {
Expand Down
1 change: 1 addition & 0 deletions ui/packages/i18n/src/locales/pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3366,6 +3366,7 @@ const pt = {
report: {
total: "Total",
totals: "Totais",
subtotal: "Subtotal",
loading: "Carregando…",
forbiddenMessage: "Você não tem permissão para ver os dados deste relatório.",
dateRange: {
Expand Down
1 change: 1 addition & 0 deletions ui/packages/i18n/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3447,6 +3447,7 @@ const ru = {
report: {
total: "Итого",
totals: "Итоги",
subtotal: "Промежуточный итог",
loading: "Загрузка…",
forbiddenMessage: "У вас нет прав на просмотр данных этого отчёта.",
dateRange: {
Expand Down
1 change: 1 addition & 0 deletions ui/packages/i18n/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1479,6 +1479,7 @@ const zh = {
report: {
total: '总计',
totals: '汇总',
subtotal: '小计',
loading: '加载中…',
forbiddenMessage: '你没有查看该报表数据的权限。',
dateRange: {
Expand Down
Loading
Loading