PivotTables: the Values caption heads the Σ Values column

With values on rows in Outline or Tabular, the Σ Values column header showed
"Values" even when the file sets dataCaption; Excel shows the caption.
This commit is contained in:
Neil Cawse
2026-10-18 19:36:37 +00:00
parent df97bf8445
commit 6421731f9a
3 changed files with 7 additions and 3 deletions
+4
View File
@@ -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();
+2 -2
View File
@@ -1259,10 +1259,10 @@ pub fn compute(wb: &Workbook, pt: &PivotTable, pivot_sheet: usize) -> Result<Out
if compact {
g.set(r, 0, Value::text(pt.row_header_caption.as_deref().unwrap_or("Row Labels")), CellKind::Header, 0, None);
} else {
// One column per row field, Σ Values ("Values") at its place.
// One column per row field, Σ Values (its caption, "Values" by default) at its place.
let mut names: Vec<&str> = 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);
+1 -1
View File
@@ -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) |