Native Pivot output, cross-filter queries and missing members
Supported manual-parent calculated items keep source and ancestor-group identities through ordinary SUM materialisation, formula edits and save/reopen; the column-only header correction also covers qualified ordinary measures
Quoted local Pivot source names
TXLSXWorksheet.AddPivotTable accepts quoted local worksheet prefixes with spaces, escaped apostrophes, exclamation marks and Unicode, followed by the ordinary supported A1 range, absolute coordinates included
For example, 'Owner''s Data'!$A$1:$B$3 resolves the existing worksheet named Owner's Data; source identity survives cache refresh, ordinary saving and reopening
An empty quoted name, malformed quote escape, missing worksheet or invalid range refuses without creating a cache or view; existing unquoted and current-sheet ranges keep their previous behaviour
Native cached worksheet output
function TXLSXWorkbook.MaterializeNativePivotTable( ATable: TXLSPivotTable): Integer; function TXLSXWorkbook.MaterializeNativePivotTable( ATable: TXLSPivotTable; AAdoptExisting: Boolean): Integer;
The operation stages the complete native compact, tabular or outline report grid together with its location, rowItems, colItems and data-axis metadata before worksheet values and output ownership are committed together; it returns 1 on success or -1 with a diagnostic for unsupported state or a collision
Supported nonempty local views keep current filters, exact cache-member identities, ordinary hierarchies, supported grouped domains, default or custom subtotals and either supported data axis; the native grid works from original aggregate values rather than recombining displayed averages or other nonadditive results
Existing cell objects and formatting stay available, whilst shrinking or moving the report clears just the unchanged previously owned values; edited output, source overlap, merges, formulas, arrays and other reports are refused before mutation
Imported scalar output calls for explicit adoption with AAdoptExisting=True; subsequent updates rely on persisted individual-cell ownership, saving and reopening included
The operation reads the current cache records and neither refreshes source data nor recalculates formulas; Cache.RefreshOnLoad=False is fine because the worksheet now holds actual staged native results
Caller record-filter callbacks take part in the detached preview but have no OOXML representation; Excel's explicit native refresh cannot reproduce arbitrary callback restrictions, whilst supported persisted manual and Slicer filters keep their wire representation
Supported SUM calculated cache fields and cache-owned calculated items follow the context-sum contract set out in Native calculated Pivot fields and cache-owned items; custom member captions and unsupported layout combinations are refused explicitly, whilst supported generated raw layout keeps unrelated XML and current member masks
TryXLSXMakeNativePivotLayout(const Xml: WideString; Table: TXLSPivotTable; AWriter: TlxPivotResultWriter; out ResultXml, Reason: WideString): Boolean is the lower-level staged layout helper living in lxPivotXml
Its final optional ACompactColumnHeaders: Boolean = False parameter turns on compact physical headers only for the represented OpenDocument column-layout profile; depth is taken from freshly generated real member tuples, whatever the declared location says. The workbook-level MaterializeOdsPivotTable route picks this policy for a coherent prior compact owner once current source/cache values have been proved and complete old-cell overwrite checks retained
Its writer is handed the whole report rectangle in row-major order, blank cells included, with zero-based offsets from the table anchor; XML and grid preflight finish before the first callback, yet caller-owned writes cannot be rolled back should a callback raise
The workbook facade provides a detached capture writer for transactional cell updates; the combined staged preview and native Variant grids are capped at 4194304 cells
The native preview path can ask for native grand-total orientation through TXLSPivotTable.MakePreview's optional AUseNativeGrandTotals parameter; existing single-writer and layout-writer calls keep their previous behaviour
Explicit Excel and OpenDocument result consumers
function TXLSXWorkbook.MaterializeOdsPivotTable( ATable: TXLSPivotTable; AAdoptExisting: Boolean = False): Integer;
Version 2.384.450 introduces an explicit OpenDocument result consumer for the qualified ordinary DATA-sorted multiple-measure profile; the existing MaterializeNativePivotTable entry keeps its Excel behaviour
Both entries rely on the existing detached preparation, on source and grid checking, on collision checks, resource limits and the transaction; the selected consumer goes out together with the generated cells and the persisted result ownership
In the observed ordinary profile of string-name ties, Excel's descending numeric sorting reverses the secondary name order, while LibreOffice keeps that secondary name order ascending both ways; this establishes neither every locale's collation nor every native Pivot layout
An OpenDocument-owned result has to be regenerated through MaterializeNativePivotTable ahead of Excel-family Pivot output; file and stream output and conversion reporting uphold the same boundary, including macro-enabled and template variants
Use MaterializeOdsPivotTable when turning an Excel-prepared result into the qualified DATA-sorted ODS profile; altering the output format alone neither regenerates consumer-specific values nor establishes equivalent ownership
The previous result owner authorises replacement only for so long as its owned cells stay unchanged; it proves no equivalence to another consumer, and edited results or failed preparation retain their earlier cells and ownership
Legacy result ownership stays Excel-specific; OpenDocument ownership uses a versioned representation carrying an explicit consumer, and consumer metadata that is missing, foreign or unknown cannot grant replacement or export permission
Qualified source-free ODS reopening reconstructs the represented DATA sort and the measure identity without provider I/O or automatic source refresh; whole-worksheet copying keeps the consumer alongside its cells, while the existing refusal of standalone owned-Pivot copying remains separate
The lower-level preview and native-layout helpers take an explicit TXLSPivotNativeConsumer target, defaulting to xlpncExcel; xlpncOpenDocument selects the represented OpenDocument ordering policy without broadening ODS conversion admission
Layout and repeated labels
Set Compact and Outline on the report and each row field before materialisation; tabular fields carry both flags as False, outline fields use Compact=False with Outline=True, and compact fields carry both flags as True
property TXLSPivotField.RepeatLabels: Boolean;
RepeatLabels defaults to False, copies independently with the field and reads or writes the native x14:pivotField fillDownLabels extension; it repeats ancestor labels in tabular and outline output and does nothing for a field whose compact and outline flags are both enabled
Each separate row field gets its own physical column, whilst adjacent compact outline fields share a label column; multiple measures on rows follow CompactData, and multiple measures on columns keep independent data captions and grand totals
Default tabular subtotals show up beneath their group; outline SubtotalTop selects the top or bottom position, whilst measures on rows use separate aggregate rows beneath the group and keep each measure's caption
Native cached output leaves absent row and column intersections blank and preserves a genuine numeric zero; ordinary Make and previews without the native option keep their previous empty-result behaviour
Inactive and measure fields inherit the report layout in the staged native metadata so that Excel's explicit refresh keeps the appropriate field and data captions; the operation preserves the live field settings and existing ownership checks
Imported repeated-label extensions accept namespace aliases, declarations on the extension element itself included; unknown unrelated XML stays preserved by the native materialisation path
Grouped members, axis order and custom subtotals
Native output supports complete numeric range groups, date groups and manual member groups held in the cache's existing typed grouping metadata; generated labels keep the exact imported GroupItemLabels, Unicode and localised date captions included
Grouping is evaluated on a detached cache, preserving the live cache's records, shared-item handles and group identities; invalid bounds, zero intervals, incomplete domains or unsupported group-item value types are refused before worksheet output changes
The existing zero-based TXLSPivotField.Position fixes the stable native row or column axis order; equal positions keep the authored field order, so newly created fields with the default position retain their previous ordering
Native imported Year/Month and parent/manual-member hierarchies keep their explicit axis sequence, whilst cache-field indices, view-field indices and display calculation base identities stay unchanged; manual groups honour the explicit Pivot item order rather than sorting group labels or cache indices
Custom row subtotals support xlpsSum, xlpsCount, xlpsAverage, xlpsMax, xlpsMin, xlpsProduct, xlpsCountNums, xlpsStdDev, xlpsStdDevP, xlpsVar and xlpsVarP, multiple selected functions, tabular or outline fields and measures on rows included
Each function aggregates the original source records at its own subtotal scope; its staged row metadata identifies the chosen function independently, preserving Excel's explicit refresh behaviour for nonadditive calculations and empty or error results
An imported custom subtotal selection rules out the implicit automatic subtotal even where defaultSubtotal is absent in native XML; applications must not pair xlpsDefault with custom functions, and such an ambiguous typed request is refused before mutation
Multiple column field levels with subtotals, unsupported compact data-axis combinations, collapsed members and custom captions sit outside this native output contract; calculated fields and items have their own narrower SUM and member-identity requirements, and raw preservation implies nothing about recalculating or materialising a feature
Saving, reopening and rematerialising keep supported grouping, axis order and subtotal identities; imported native views and independently copied typed caches have likewise been verified against Excel on both initial open and explicit refresh
Multilevel column subtotals and measure captions
Native local materialisation supports default and custom subtotals across multiple column-field levels, including supported layouts with multiple measures on columns or rows; each subtotal aggregates the original source records at its own scope
Set a column field's Subtotals to [xlpsDefault] for automatic subtotals or to the supported explicit functions described above; several explicit functions can be selected together, while combining xlpsDefault with explicit functions stays an ambiguous request that rejects before mutation
With multiple measures on columns, subtotal captions identify the corresponding measure; explicit-function subtotal captions also identify the aggregation, whilst ordinary data captions and grand totals keep their measure identity
At the intersection of a row subtotal and a column subtotal, two different explicit functions leave the result blank; for example, an explicit row SUM crossed with an explicit column AVERAGE does not arbitrarily choose one calculation, whilst a default subtotal crossed with an explicit function uses that explicit function
Sparse reports reserve enough output columns for the complete field-caption header and any measure-caption column even when there are fewer result columns than header fields; worksheet bounds and the full report rectangle are checked before output starts
Subtotal rows or columns render only for fields with an inner level to summarise: the innermost row or column field emits none even when its defaultSubtotal flag stays set, matching Excel on single-field and multilevel axes; MIN and MAX measures over complete numeric-range and date groups are verified natively at bucket, subtotal and grand-total scopes
Collapsed members materialize natively: a row or column item with hidden details renders as one aggregate row carrying its plain label, replaces its whole descendant subtree and applies under every parent, whilst enclosing blocks keep their subtotals and the collapsed level itself never repeats a separate subtotal row; the sd flag round-trips through save and native refresh
Collapse composes with manual member groups and outline layouts: a discretePr parent item collapses through its group-ordinal identity, and outline fields with subtotals on top render the default subtotal as the caption row itself, so a collapsed group appears as one plainly labelled row in every qualified layout
Column-axis collapse spans a collapsed member across its descendants in a single range, and compact shared-label rendering stacks the single-measure caption above the field captions with the implicit data column headed by its plain Total caption
Members order natively by a chosen measure: sortType with the measure resolved from the autoSortScope data-axis reference (or rankBy) sorts rows or columns by that measure ascending or descending, with invalid metrics grouped last, deterministic label tie-breaking and blank members demoted; exact tie permutations under equal metrics follow Excel's unstable sort and are not reproduced here
Collapsed outer column members compose with multilevel column subtotals: the collapsed member spans its descendants in one range beside the expanded groups' month columns, subtotal columns and the grand-total column; the stacked measure caption applies only to the compact profile without a column field, where native reserves the corner cell
The supported native metadata and cached report cells keep the column hierarchy, subtotal functions and measure captions through save/reopen and explicit Excel refresh; the existing restrictions on collapsed members, custom member captions and unsupported layout combinations still apply
Modern native count-ranking filters
Represented native count filters expose FilterType=xlpfTopCount or xlpfBottomCount, a positive integer Value1 and an identified ordinary measure through DataField; set DataFieldIsMeasureIndex=True when the index identifies the zero-based measure position
MaterializeNativePivotTable selects the top or bottom members using that measure, every member tied at the cutoff included; ordinary other measure columns and totals follow the filtered population
A count greater than the member domain keeps all eligible members; zero, fractional limits, unresolved measure identities, unqualified aggregation modes and unsupported source populations refuse explicitly
Fresh filters and represented same-owner, same-measure imported count edits qualify; call MaterializeNativePivotTable after changing Value1 before saving the updated report and criteria
Filter replacement, unrelated advanced metadata edits, grouped or calculated count-ranking execution stay outside this profile; the four cumulative ranking modes have their own separate selected-metric and SUM contracts below; direct criteria-only saving of an imported count edit keeps the existing advanced-filter guard
For retained standard percentage or sum-ranking top10 profiles that stay untyped, MaterializeNativePivotTable explicitly rejects before changing report cells; ordinary SaveAs and reopening keep the original Pivot definition
This is not a generic unknown-filter rule or a promise that other preview/materialisation entry points reject the same profiles
Modern native count filters are distinct from legacy AutoShow: Excel authors and refreshes the qualified ordinary TopCount profile, whilst the retained legacy AutoShow and grouped native ignored-filter observations remain separate boundaries
Separate native controls qualify manual grouped row and column sorting with two measures whose orderings disagree, proving ownership by the selected second measure; this is no arbitrary multi-key sorting qualification
Selected COUNT and AVERAGE count ranking
Ordinary xlpfTopCount and xlpfBottomCount also rank an identified COUNT or AVERAGE measure; the selected measure position is independent of its source-field identity, multiple measures over the same field included
COUNT ranks nonempty selected measure values, nonempty text and Boolean values included, whilst skipping missing values; it does not rank category population or apply numeric-only COUNTNUMS semantics
AVERAGE ranks the mean of original numeric records and ignores text, Boolean and missing values; it does not average member totals that are already aggregated
For A=[20,30,50], B=[50,70], C=[90] and D=[2,4,6,8], TopCount 2 picks A and D by COUNT, B and C by AVERAGE, and A and B by SUM; BottomCount 2 picks B and C by COUNT and A and D by AVERAGE
The existing positive integer limits and cutoff-tie inclusion keep applying through source changes, same-owner target edits, public authoring, repeated execution and save/reopen; other measure columns and grand totals follow the filtered population
Actual native comparisons qualify a source with four real fields and separate SUM, COUNT, AVERAGE and COUNTNUMS measures; an earlier two-field/four-measure saved-native AVERAGE shape failed normal reopening even before library processing and stays outside the qualified compatibility profile
Ambiguous source-field identities, grouped/calculated contexts, source errors, empty strings and members without the required metric explicitly refuse in this COUNT/AVERAGE profile; AVERAGE additionally turns away date-valued sources and nonfinite inputs or intermediate means
COUNT recognises finite nonempty date values through the existing type classification, but ranked-date native compatibility is not qualified by this increment; the four cumulative sum/percentage modes follow the separate selected-metric contract below
Ordinary numeric ranking aggregations
Ordinary xlpfTopCount and xlpfBottomCount also take selected COUNTNUMS, MAX, MIN, PRODUCT, STDEV, STDEVP, VAR and VARP measures over finite numeric source values
Each member's metric is finalised from its original numeric records before applying the existing positive integer limit and cutoff-tie inclusion; the selected measure remains independent of other aggregations over the same source field
Sample deviation and variance use the record count minus one; population forms use the full record count; report grand totals recompute the selected aggregation across original records of retained members rather than summing their displayed aggregate values
For A=[11,13,7,9,10], B=[5,13,3,15], C=[14,12,13], D=[11,9,9] and E=[12,2,3,9,8], TopCount 2 picks A+C by SUM or AVERAGE, A+E by COUNTNUMS or PRODUCT, B+C by MAX, C+D by MIN, and B+E by either sample/population deviation or variance
The qualified two-field source has the selected aggregation at measure ordinal zero and a separate SUM control at ordinal one; genuine imported execution, count-limit edits, source edits and fresh public top/bottom rules keep their identities through save/reopen and actual native refresh
This added COUNTNUMS profile accepts numeric sources only; mixed-value skipping is not qualified here, and the preceding nonempty COUNT and numeric AVERAGE profiles keep their own type semantics
Sample STDEV and VAR require at least two numeric records per eligible member; population STDEVP and VARP require one and keep the existing singleton result of zero, whilst this increment's independent native positive members all contain at least three records
Nonnumeric sources, insufficient samples, nonfinite selected results, invalid statistical state, unresolved or ambiguous measure identities and unsupported grouped/calculated contexts refuse before report publication; an unrelated unused PRODUCT overflow does not turn down a finite selected MAX result
Swapping an imported retained TopCount predicate for BottomCount remains an unsupported owner edit; create a fresh BottomCount rule for the qualified public authoring path
The four cumulative sum/percentage predicates follow the selected-metric contract below; selected non-SUM value comparisons follow the qualified contract below, whilst other calculated-context combinations remain separate
Native calculated-field count ranking
xlpfTopCount and xlpfBottomCount can select an explicitly identified cache-owned native calculated field used as a SUM measure with normal display, one ordinary row field, no column field and no grouped or calculated-item plan in play
The existing native expression plan finalises each eligible member metric once; bounded count selection keeps all members tied at the cutoff, then existing measure accumulation recomputes displayed values and totals from retained original dependencies
For the qualified Ratio=Sales/Units source, TopCount 2 selects C+D with grand Ratio 110/3, while BottomCount 2 selects A+B with grand Ratio 170/110; source denominator edits alter the selected members independently of the raw Sales SUM order
The count limit must be finite, positive, integral and at most High(Integer); every selected metric must be finite and numeric, and missing or ambiguous measure identities are explicitly refused
Known imported count predicates retain their limit-only edit contract; calculated count owners validate retained structure even when the limit is unchanged, whilst unknown attributes, duplicate or foreign owners refuse before any report writer callback
Selection vectors, ordering, old/new allocation overlap, the bounded heap and formula temporary storage are charged before being used; selection work joins the existing sixteen-million work forecast and the added storage respects the 512 MiB hard bound
Ten actual native outputs qualify both directions, one/all limits, denominator edits and cutoff ties; four library-only repeats are separate, and rejected definitions keep their original raw bytes through ordinary saving
This moves no table-level AddCalculatedMember postprocessing earlier and adds no formula engine; grouped, calculated-item, multi-axis and transformed-display ranking remain outside this finite profile, and calculated cumulative modes remain unsupported
Selected ordinary value comparisons
Ordinary native xlpfValueEquals, xlpfValueNotEquals, xlpfValueGreaterThan, xlpfValueGreaterThanOrEqual, xlpfValueLessThan, xlpfValueLessThanOrEqual, xlpfValueBetween and xlpfValueNotBetween compare the actual selected measure
Set an explicit resolvable DataField identity, using DataFieldIsMeasureIndex=True for a zero-based data-measure ordinal; absent or ambiguous identities refuse rather than quietly selecting the first measure
COUNT uses nonempty selected source values, AVERAGE uses original numeric records and the other standard numeric kinds use their finalised aggregate; the preceding type, finite-result and sample-population boundaries remain in force
For the source population in the ordinary aggregation example above, AVERAGE greater than 9.8 keeps A+C and COUNT greater than 4 keeps A+E; comparing raw SUM instead wrongly keeps all five members
Value1 must be a finite numeric threshold; between/not-between also demand finite Value2 with Value1 <= Value2, keeping the existing inclusive interval and comparison tolerance semantics
All eight AVERAGE comparators have actual native opened/refreshed output evidence; COUNT and COUNTNUMS, MAX, MIN, PRODUCT, STDEV, STDEVP, VAR and VARP have finite greater-than representatives, without claiming exhaustive operator-by-aggregation coverage
Fresh public rules, repeated execution, source changes and save/reopen keep the qualified result; source changes preserve the imported predicate bytes, whilst changing an imported threshold, operator, selected measure or other owned metadata stays unsupported in this increment
The retained filter owner must have the unique same-namespace known condition structure; unknown attributes, foreign or duplicate owners, invalid operands, unsupported non-SUM grouped contexts, missing metrics or exhausted work/memory limits refuse before any partial report is published
Unchanged unsupported definitions still save through their raw-preservation path; this establishes no execution support
Legacy synthetic count comparisons use category population, synthetic percentage comparisons use population percentages and synthetic sum comparisons use sums; the four cumulative ranking modes have their separate selected-metric contract, and late calculated-member value filters keep their existing finalised-metric contract
Qualified layout and filter categories
Represented multilevel column subtotals, collapsed-member compositions and custom captions carry positive execution and native lifecycle evidence; the ordinary selected-measure ranking profiles cover count and cumulative modes, eleven aggregation classes, selected value comparisons and finite native calculated-field count ranking
These are the bounded layout/filter categories described in this reference; source eligibility, sample minimums, split ties, imported owner edits and every grouped or calculated context keep their stated limits, with raw preservation and rejected execution assessed separately
Selected ordinary cumulative metrics
xlpfTopSum, xlpfTopPercent, xlpfBottomSum and xlpfBottomPercent identify an explicitly selected ordinary measure through DataField and DataFieldIsMeasureIndex; COUNT, AVG, COUNTNUMS, MAX, MIN, PRODUCT, STDEV, STDEVP, VAR and VARP reuse the existing member accumulator/finaliser paths
Selection orders finalised member metrics and accumulates them to the target; percentages use the sum of eligible member metrics as their denominator, while displayed values and grand totals retain standard aggregation over the original retained records
For the qualified AVG TopPercent source, the selected member means are 90 and 60, whilst the grand AVG is 210/3=70; for PRODUCT, selected member products 90090 and 5184 produce a report grand PRODUCT of 467026560
The new non-SUM profile demands one ordinary ungrouped row axis, normal display, finite non-negative eligible member metrics and a positive finite sum of those metrics; calculated and grouped cumulative execution remains outside this profile
COUNT needs a nonempty selected source value per eligible member and AVG needs a numeric selected source value; their existing error, mixed-value, empty-string and unqualified date-AVG restrictions remain, whilst the other eight classes keep numeric-only sources, sample-size minimums and finite finalizer results
Sum targets stay finite and non-negative, percentages stay within zero through 100, and a zero target considers at least one member; split equal-metric boundaries, negative or zero-total non-SUM populations, invalid identities and positive scaled-target underflow refuse before publishing a report
Known imported predicates permit owned target-only edits after explicit materialization; selected non-SUM owners validate complete retained structure even when the target is unchanged, and opaque attributes, foreign namespaces or duplicate owner containers refuse whilst ordinary saving keeps their original definitions
Fresh programmatic selected cumulative and native calculated TopCount/BottomCount rules support immediate repeated materialization, SaveAs and another call; the workbook derives unspecified source-order normalisation from a unique internal raw binding with no imported source part name, while real imported definitions retain strict source-order validation
Sixteen genuine native profiles cover COUNT/AVG in both directions plus eight further TopSum aggregation representatives; thirty actual output openings and refreshes qualify source edits, target edits and fresh rules, with twenty additional repeats counted separately as library-only
The existing SUM contracts below keep their signed Top, zero-total, source eligibility and split-tie behavior; the new finite non-SUM population rules leave those SUM semantics unchanged
Modern native cumulative SUM ranking
FilterType=xlpfTopSum identifies the represented standard top-sum ranking separately from sum-comparison filters; Value1 is a finite non-negative cumulative target, and DataField identifies the numeric SUM measure
MaterializeNativePivotTable orders eligible members by descending measure value and keeps a prefix until its cumulative sum reaches the target; the other displayed measures and totals follow that population
At least one member is selected before testing the target, so a zero target keeps a unique largest member; if the target cannot be reached, every eligible member stays selected, including the qualified mixed-negative and all-zero positive-target profiles
Same-owner target edits, a fractional 90.5 target included, source refresh and fresh public authoring are qualified through calculation, saving, reopening and actual native refresh; materialize after editing the predicate before saving it
A cumulative boundary that would split equal-metric members explicitly refuses because the native selection order has not been qualified for use; count ranking retains its separate all-ties rule
Negative population totals, empty or non-numeric measure items, ambiguous measures, grouped and calculated contexts also refuse; non-SUM measures use the separate finite selected-metric contract above; an all-zero population with target zero falls under the split-boundary refusal
Ordinary saving keeps the original report definition when execution refuses; broader signed-population semantics remain outside this contract; TopPercent and nonnegative bottom cumulative predicates follow their separate contracts below
Modern native cumulative percentage ranking
FilterType=xlpfTopPercent is distinct from count ranking and percentage-comparison filters; Value1 is a finite percentage in the inclusive range zero through 100, and DataField identifies the ordinary numeric SUM measure
The cumulative target is the eligible population SUM multiplied by Value1/100; members are taken in descending measure order, rather than selecting a percentage of the item count
Zero percent keeps a unique largest member, fractional percentages keep their value, and positive percentages with a zero population total hold on to every eligible member in the qualified all-zero or mixed-zero-total profiles
A mixed-negative population with a positive total can reach a 100-percent target without taking in every member; the qualified native case retains a sum of 140 from a population total of 130
Same-owner target edits, source refresh, denominator changes, fresh authoring and save/reopen are qualified via actual native opening and refresh of representative outputs
Split equal-metric boundaries, negative population totals, empty or non-numeric measures, grouped or calculated contexts and invalid measure identities explicitly refuse; a positive percentage scaling a positive total to a zero target also refuses rather than making up an underflow rule
Ordinary saving keeps the original report definition on execution refusal; general native tie ordering and unrepresented extreme floating-point behaviour remain separate boundaries; BottomSum and BottomPercent follow the non-negative contract below
Modern native bottom cumulative ranking
xlpfBottomSum and xlpfBottomPercent identify independent predicates whose selected DataField is an ordinary numeric SUM measure; eligible source values must be finite and non-negative
Members are taken from smallest to largest SUM until the cumulative target is reached; Value1 is a non-negative sum target or a percentage in the inclusive range zero through 100, fractional values included
For member sums 80, 10, 60 and 20, BottomSum 25 keeps the members with 10 and 20, whilst BottomPercent 50 keeps those with 10, 20 and 60
A zero target considers at least one member; an unattainable positive target keeps all eligible members, and a positive percentage on a zero-total population likewise keeps all eligible members
Represented same-owner target edits, source refresh, fresh public authoring and repeated materialisation of the same workbook are qualified through save/reopen and actual native opening and refresh of representative outputs
Split equal-metric thresholds, negative or empty source measures, grouped or calculated contexts, nonfinite results and positive scaled-target underflow explicitly refuse before output is published; ordinary saving retains the original report definition
Editable predicate identity is validated even when its numeric target is unchanged; fresh source-order normalisation keeps the existing behaviour
Native display calculations
Set each ordinary data field's ShowDataAs or ExtendedShowDataAs prior to calling MaterializeNativePivotTable; basic and extended display modes are mutually exclusive
Basic modes take in difference, percent of a base item, percent difference, running total, percent of row, column or grand total and index; extended modes take in parent row, parent column and selected parent percentages, cumulative percentage and ascending or descending dense ranks
BaseField is the zero-based Pivot field index for comparisons, running totals, selected parent percentages and ranks; comparisons work from the zero-based BaseItem position, or from xlPivotBaseItemPrevious and xlPivotBaseItemNext for adjacent visible members in the effective display order
Parent row and parent column percentages go for the corresponding innermost axis field without using BaseField; a missing corresponding axis leaves those results blank
Simple percentages divide by the original aggregate at the relevant scope, nonadditive averages included; cumulative percentages add up displayed member aggregates and use the original axis total for an innermost base field, whilst an outer base field uses the sum across its matching remaining members, so averages can exceed 100 per cent
Native ranks count distinct preceding aggregate values, and comparisons preserve Excel's blank and error behaviour for absent intersections, missing bases, zero divisors and previous or next boundaries; simple percentages treat an absent numerator as zero
Grand totals follow the selected mode's native semantics, blank totals along a comparison or running axis included; changing a display mode keeps the report's transactional ownership, collision and budget checks
Saving and reopening keeps the chosen basic or extended mode and base identities, and staged native metadata backs an explicit Excel refresh; ordinary Make and previews without the native option keep their existing calculation contract
Slicer cross-filter availability
property TXLSXSlicerCache.ItemHasData[Index: Integer]: Boolean;
This read-only query evaluates the current supported non-OLAP cache records, ignoring this Slicer's own selection but retaining other Slicer selections, manual filters, caller predicates and applicable aggregate filters
Availability is the union across connected views; historical members without matching records have no data, blank measures have no data, and nonempty text, Boolean, zero, error and date measures all count as data under the verified native contract
The query uses a read lease and a detached record preview, preserves live handles and selection and honours FormulaArrayMemoryLimit; callback failure, reentry, invalid bindings or unsupported aggregate calculated members raise before any live changes are committed
Querying availability neither refreshes caches nor recalculates formulas, performs file I/O or updates serialised native no-data flags; applications should not infer native UI state from this read-only operation
TlxPivotRecordWriter = procedure(ATable: TXLSPivotTable; ARecordIndex: Integer) of object; function TXLSPivotTable.MakeRecordPreview(AWriter: TlxPivotRecordWriter; AFilterOwner: TObject = nil; AFilter: TlxPivotRecordFilter = nil): Integer;
The advanced record callback is handed the detached preview and a zero-based record index once supported simple and aggregate filtering has run; EvaluationSourceTable keeps the original view identity and the return value is the number of emitted records
A replacement filter substitutes only the supplied owner's registered callback; other owners and the external predicate stay active, and a non-nil replacement callback calls for a non-nil owner
Explicit historical-member purge
Removed := Workbook.PurgePivotCacheMissingItems(
Pivot.CacheId, 0);
if Removed < 0 then
raise Exception.Create('The cache member purge was rejected');
TXLSXWorkbook.PurgePivotCacheMissingItems(ACacheId: Integer; ARetainMissingItemsPerField: Integer = 0): Integer takes out unused members after complete validation and remapping of supported linked views and Slicers
It reports the total number of shared items removed across all fields, zero for a successful no-op, or -1 with diagnostic 1402; current records keep every referenced member, plus at most the requested number of unused members per field, chosen by greatest original shared-item index
Retained members hold their original relative order and object handles whilst logical indices become compact; linked field/item handles, manual hidden and detail flags, active page or comparison members and Slicer selections keep their identities
Domain flags and bounds are recomputed from the retained domain; supported imported compressed row/column and page positions are remapped explicitly, whilst grand-total dummy references and data pseudo-field ordinals stay unchanged
Ordinary complete local worksheet caches are supported; grouped, calculated, member-property, OLAP, external, incomplete or ambiguous caches and unsupported opaque identity metadata are refused before mutation
Removing an active page or comparison member, a whole selected Slicer subset or a previously nonempty effective intersection is refused atomically; primitive member attributes that would be lost during typed rebuilding are likewise refused
The known materialisation ownership extension stays unchanged because its coordinates and typed value tokens contain no cache-member indices; unrelated opaque extensions are not assumed safe
Purge neither refreshes source data nor rewrites worksheet report cells, invokes record callbacks or applies MissingItemsLimit metadata automatically; refresh stays append-only unless this operation is explicitly requested
Advanced purge coordination
TXLSPivotCache._PrepareMissingItemPurge gives back an opaque TXLSPivotCachePurgePlan; applications would normally use the workbook facade so that every linked view and Slicer is brought in
MapItem and RemainingItemCount inspect cache remapping, StagePivotField registers a linked field and returns its stage index, and MapViewItemPosition inspects that field's wire position mapping; removed members map to -1 and RemovedCount gives the total removal count
Validate checks the original schema, records, field/item ownership identities and staged view selections; Commit validates once more and transfers the prepared ownership without allocation or callbacks after the first live exchange
The plan owns detached snapshots, keeps its mutable staged cache private and never owns the original cache or view objects; keep those originals alive until the plan's Destroy releases staging, and commit each plan only once
Rejected field staging rolls that stage back so the plan can be reused; unsupported mutations after preparation are refused before commit