HotXLS documentation

Pivot format ownership and workbook copies

Version 2.384.144 preserves represented PivotTable number formats, custom Pivot styles and standard differential area formatting across modern workbook-local style pools, including save-time compaction and repeated saves

Copy an attached PivotTable

TXLSXWorksheet.AddPivotTableCopy clones an attached source PivotTable and cache into the destination workbook, resolves custom number-format codes in the source owner, and registers independent destination identities

The destination can already contain unrelated custom number formats, conditional formats and Pivot styles with the same numeric identities; those existing styles keep their own meaning

Copies receive a unique cache identity and independent mutable state; a default copied name receives an available suffix, while an explicitly duplicated name is rejected

Source worksheet, range, query and external-workbook bindings retain their stored meaning; supply the destination source data before requesting a native refresh

Author and interpret number formats

TXLSXWorksheet.PivotSetDataFieldFormat accepts a data field attached to the current workbook and a nonempty format code, registers that code in the workbook pool, and returns its one-based custom-pool index

A foreign or detached data field is rejected with 0 without adding a format; the worksheet receiver can be any worksheet in the data field's owning workbook

Direct assignments to TXLSPivotDataField.NumberFormat use the authored one-based custom-pool convention, with 0 for General; imported modern values retain their native OOXML identity until explicitly replaced

Use PivotSetDataFieldFormat to author a format by code rather than assigning an imported native number-format ID as a custom-pool index

TXLSPivotCacheField.NumberFormat and TXLSPivotField.NumFmtId retain native OOXML IDs in modern workbooks; copying resolves each supported custom ID through its actual source format code

Sparse imported IDs are normalized through the actual source styles mapping, and imported built-in IDs remain built-in; unknown or overflowing custom identities retain source data but reject operations that require an unresolved mapping

Retain differential area formatting

TXLSPivotTable.FormatsXml binds represented area-format references to workbook-owned differential styles, independently of the transient conditional-format pool

Standard font, fill, border, alignment, protection and number-format overrides survive copying, saving, reopening and repeated saves even when the destination already uses their original numeric IDs

Cross-workbook copies resolve indexed and theme colors in the source workbook before storing their copied RGB appearance; same-workbook copies preserve their original theme-font schemes in the existing owner context

Copied differential fonts resolve their explicit names or supported source-native fallback in the owning workbook context, including recognized default-theme version profiles; a complete source minor or major theme font collection maps to the destination slot holding the equal complete collection; when neither complete collection matches, the original represented scheme remains bound to the destination theme

Custom Pivot style sections own their complete imported differential objects, and conflicting destination names receive a new name; unresolved or unsafe foreign identities and a destination custom style shadowing a source built-in name are rejected

Preserve the native default font

Modern XLSX saving retains the represented source font zero, including its name, fractional point size, emphasis, color, family, charset and scheme; this preserves supported differential-font fallback after saving and reopening

The native default font is separate from the public custom font pool: Fonts[0] is the first pool entry and writes as native font 1, so editing it does not replace native font zero

New workbooks keep the existing implicit Calibri default, and the existing XLSB default-font override retains priority

Save and compact without losing identities

Formats referenced only by Pivot models and differential styles remain live during style-pool compaction; their represented and retained raw number-format references are remapped together

Owned Pivot differential entries are registered before borrowed conditional styles on every save, with custom table-style differential entries following that combined prefix

Normalized owned Pivot definitions take precedence over original compressed-part replay, so sparse imported IDs cannot be restored accidentally during saving

Rejection and remaining boundaries

AddPivotTableCopy returns nil when source format ownership is unknown, a custom identity cannot be resolved, differential appearance cannot be mapped faithfully, or unsupported opaque identities require remapping

Validation and allocation are staged before appending the destination cache, table and style objects; rejected copies preserve destination number-format, differential-style, table and cache collections

Detached models do not inherit a borrowed workbook format owner through Assign or AssignPivotOnly; keep the source attached while copying workbook-local custom formats

Cross-workbook copies preserve the strictly validated identity-free x14 hideValuesRow extension and empty xpdl:pivotTableDefinition16 extension; other unknown extensions and supplemental opaque Pivot records remain explicit boundaries

Unknown differential appearance XML remains preserved in its source owner and rejects cross-workbook mapping when its identity safety cannot be established

The focused qualification uses the existing RAD Studio 37.0 Win64 compiler and independent Excel appearance controls; it does not establish a broader compiler or platform matrix

Cross-workbook copies carry unequal theme font schemes unchanged: when no equal complete script collection exists in the destination, the differential keeps its scheme attribute and the destination theme resolves the slot at render, matching native sheet-move copies; concrete fonts continue to carry by value into the destination style pool

Differential future-feature extensions carry opaquely: an extLst inside a copied differential passes through verbatim without semantic interpretation, as native refresh and save preserve it; foreign namespaces outside extension subtrees keep their explicit-remapping refusal

Unequal theme scheme persistence

Version 2.384.316 fixes the unequal-collection path documented earlier in 2.384.310: the earlier qualification exercised an equal-collection mapping and did not establish its unequal fallback

When a represented nonuniform source font collection has no equal destination collection, copying retains its original major or minor scheme and stored font properties; an equal opposite-slot collection still takes precedence

The destination theme determines the resulting glyph face, so copying a theme scheme across deliberately different themes does not promise identical glyph appearance

Version 2.384.317 adds complete owned custom-style section persistence for the qualified underline, explicit false emphasis and custom number-format profile; other appearance combinations and opaque foreign identities retain their documented boundaries

Own custom Pivot style-section differentials

Imported custom table-style sections retain a complete differential object independently from their existing appearance summary; cross-workbook Pivot copies stage its number-format identities in the destination owner and preserve its complete represented XML

The qualified whole-table section retains underline, explicitly disabled bold and italic, and a custom number format through source resaving, copying, source destruction, destination edits, pool compaction, saving, reopening and native Pivot refresh

Loaded table and Pivot availability flags honor their default true value when omitted, and accept the standard explicit XML boolean values

Calling SetSection or SetSectionEx replaces the imported section with the caller's requested summary and clears its previous differential object and unsupported-summary state

Unresolved number-format identities and foreign differential structures reject the copy before destination caches, PivotTables, custom styles or number-format pools change

Actual native DisplayFormat qualification additionally covers source-owned theme/tinted and indexed font colors, a non-solid pattern and a linear gradient across copying, editing, saving, reopening and native refresh; destination themes and palettes deliberately differ in those controls

In the selected whole-table section profile, Excel retains the custom number-format differential but displays General on both the source and copies; use the separately qualified Pivot data-field formatting API for visible custom measure formats

Native copies preserve the represented applied values and formatting; unspecified font faces resolve in the destination workbook context, and no pixel-identical font promise is made

Portable rendering continues to refuse richer section appearances that its current summary cannot represent; foreign or unresolved identities keep their explicit remapping boundary

Copied result ownership and OpenDocument caches

For represented materialized local views, a metadata-only AddPivotTableCopy first validates the attached source and its represented currentness, then clones independent mutable cache and table state without inheriting an absolute claim on the original result cells

The destination must contain the represented local source before the copied view is materialized; source differences require explicit refresh, and materialization still refuses occupied unowned cells, stale captures and other unsafe destinations

Whole-worksheet graph copying carries represented source/result coordinates, typed Pivot metadata and owned result values together, including the OpenDocument two-header layout, explicit data caption and first-data-row relationship

The copy operation's independent cache models do not imply stable private cache identities across formats; ODS saving and reopening may canonicalize views over the same verified live source, after validating each view's source/cache agreement

Cache identifiers are workbook-local references, so use the current view's CacheId after reopening and do not treat an old private identifier as persistent source identity

Unknown extension content is not silently discarded or granted represented ownership; unresolved source, foreign context, stale result and explicit copy/remapping boundaries remain checked

Represented homogeneous parent subtotals can persist an automatic subtotal with a canonical source-owned member-caption template; importing it restores the original concrete subtotal aggregation rather than exposing a guessed function from the caption text

The existing single-measure SUM suffix remains its actual measure caption, with literal question marks and backslashes preserved, and the supported multiple-measure suffix remains the represented subtotal word