Expand description
PivotTables: reading the source list, grouping and aggregating, laying out the report and writing it onto the sheet as static, styled cells.
Behaviour follows Excel’s documented PivotTable model (rows/columns/values/filters areas, Compact/Outline/Tabular layouts, subtotals, grand totals, show-values-as); the code and the look (our own palette) are original.
Re-exports§
pub use crate::base::quote_sheet;
Structs§
- OutCell
- Output
- A computed report: a dense grid relative to its top-left, with row kinds.
- Source
- The source list: header names, per-column number formats and the records.
Enums§
Constants§
- MAX_
AXIS_ FIELDS - Most fields in the Rows plus Columns areas.
- MAX_
OUTPUT_ CELLS - Largest report written (cells).
- MAX_
SOURCE_ CELLS - Largest source block read (cells).
- MAX_
VALUE_ FIELDS - Most fields in the Values area.
- NOT_
A_ VALUE_ CELL - Why Show Details turns a cell down when it isn’t a value cell of a PivotTable (the front end edits that cell instead).
Functions§
- chart_
link - The link a PivotChart stores to its PivotTable:
Sheet2!PivotTable1. - chart_
series - A PivotChart’s series for a report written at
origin: categories are the innermost row items, one series per item column (column items × value fields); totals are left out. - clear_
output - Clears a pivot’s last output area.
- compute
- Computes a PivotTable report from the workbook.
- detail_
cells - The cells of the report grid (relative to its top-left) where
detail_recordsfinds records: its value, subtotal and grand total cells, from one computation of the report. The same errors asdetail_records. - detail_
records - Show Details: the source list and the indices of its records behind the value cell at
(
row,col) of the report grid (relative to its top-left), in source order.Nonewhen that cell holds no value (a label, a header, a blank). An error, for any cell, when the report on the sheet is no longer what the source computes: the cell’s records would be another cell’s. - distinct_
labels - Distinct item labels of a source column, sorted like the field list shows them.
- func_
caption - Excel’s caption verb for a function (“Sum of Sales”). Count Numbers is captioned “Count of Sales”, as Excel names it and as the XLSX reader names a value field saved without a name.
- item_
label - The label of a source value under a date grouping (for filters and field lists).
- links_
to - Whether a PivotChart link points at
pivotonsheet. - parse_
chart_ link - (sheet, PivotTable name) of a PivotChart link; a leading
[Book.xlsx]is ignored. - range_
text - Absolute reference text for a range on a sheet:
Sheet1!$A$1:$E$20. - read_
source - Reads the source list.
- refresh
- Recomputes a pivot and writes its report. With
replacefalse, refuses when the target area holds other data. Returns the written area. - resolve_
source - Resolves source text (range, table name or defined name) to (sheet, range including header).