diff --git a/crates/engine/src/cmd/pivot.rs b/crates/engine/src/cmd/pivot.rs index 8adf5e301..c64d0902b 100644 --- a/crates/engine/src/cmd/pivot.rs +++ b/crates/engine/src/cmd/pivot.rs @@ -1872,6 +1872,10 @@ mod tests { assert_eq!(text(&s, "A3"), "Region"); assert_eq!(text(&s, "B3"), "Values"); assert_eq!(text(&s, "C3"), "Total"); + // The Values field's caption heads its column, as in Excel's saved reports. + edit_pt(&mut s, |p| p.data_caption = Some("Data".into())); + assert_eq!(text(&s, "B3"), "Data"); + edit_pt(&mut s, |p| p.data_caption = None); s.execute("pivot.layout", json!({"layout": "compact"})).unwrap(); // Σ Values before Region: the value fields are the outer items. s.execute("pivot.moveField", json!({"field": "Values", "from": "rows", "to": "rows", "position": 0})).unwrap(); diff --git a/crates/engine/src/pivot.rs b/crates/engine/src/pivot.rs index c19126e0b..7bf4c9358 100644 --- a/crates/engine/src/pivot.rs +++ b/crates/engine/src/pivot.rs @@ -1259,10 +1259,10 @@ pub fn compute(wb: &Workbook, pt: &PivotTable, pivot_sheet: usize) -> Result = row_fields.iter().map(|f| f.header()).collect(); if let Some(p) = vpos { - names.insert(p.min(names.len()), "Values"); + names.insert(p.min(names.len()), pt.data_caption.as_deref().unwrap_or("Values")); } for (i, name) in names.into_iter().enumerate() { g.set(r, i, Value::text(name), CellKind::Header, 0, None); diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 816878e08..77ea1b9f6 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -339,7 +339,7 @@ The inventory carried over from the 2026-10-07 ROADMAP.md, updated for what land | 2026-10-11 | minor | Password-encrypted workbooks open (#11): Essentials file-opening work 24–36 h | | 2026-10-11 | minor | Worksheet functions 505 / 523 (96.6%; 496 working): ODDFPRICE, ODDFYIELD, ODDLPRICE, ODDLYIELD | | 2026-10-11 | minor | Worksheet functions 503 / 523 (96.2%; 494 working): PERCENTOF, EUROCONVERT | -| 2026-10-13 | minor | PivotTables: sort by a value field (`pivot.sort by:`), row/column/data/grand-total/empty-cell captions, field and item custom names, manual item order, per-field subtotals and number formats, Repeat Item Labels, Values row, classic layout. Refreshing 26 PivotTables from 11 real workbooks: 7,271 → 3,446 cell differences against Excel's saved output, the rest filters (#498) and Excel's order among tied values | +| 2026-10-13 | minor | PivotTables: sort by a value field (`pivot.sort by:`), row/column/data/grand-total/empty-cell captions, field and item custom names, manual item order, per-field subtotals and number formats, Repeat Item Labels, Values row, classic layout. Refreshing 26 PivotTables from 11 real workbooks: 7,271 cell differences against Excel's saved output on main (6e984bb) → 3,446, the rest filters (#498) and Excel's order among tied values | | 2026-10-11 | minor | Worksheet functions 502 / 523 (96.0%; 493 working): BAHTTEXT | | 2026-10-11 | minor | Worksheet functions 502 / 523 (96.0%; 493 working): TRIMRANGE | | 2026-10-11 | minor | View › Formula Bar and Zoom 100% are engine commands (CLI/MCP); catalog 258 → 260 / 290 (#289) |