Skip to content

#2455 - Added hook for naming copied pivot tables during worksheet copy - #2457

Merged
JanKallman merged 1 commit into
develop8from
feature/i2455
Aug 10, 2026
Merged

JanKallman merged 1 commit into
develop8from
feature/i2455

Conversation

@swmal

@swmal swmal commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a naming hook for pivot tables copied during a worksheet copy, mirroring the existing table copy hook. Also fixes a pre-existing bug in ExcelPivotTable.Name that this work surfaced.

See #2455

Changes

Feature

  • New ExcelPivotTableCopyEventArgs (SourceTableName, DefaultName, NewName).
  • New PivotTableCopyHandler on ExcelWorksheetCopyOptions, invoked for each copied pivot table. The caller can set NewName to rename the copy.
  • CopyPivotTable now returns its source→copy name map; an ApplyPivotTableCopyOptions pass runs last in Copy, routing the rename through the ExcelPivotTable.Name setter so name uniqueness is validated. GETPIVOTDATA is address based, so no formula adjustment is needed.

Bug fix

  • ExcelPivotTable.Name validated and bookkept against the table collection (_tableNames / ExistsTableName) — a copy-paste from ExcelTable. Corrected to the pivot collection (_pivotTableNames / ExistsPivotTableName). The copy constructor no longer sets the name via the setter, avoiding a double registration in _pivotTableNames.

Tests

Added coverage in CopyWorksheetTests for default generated naming, the rename hook, source/default name context, null NewName, name-collision rejection, and GETPIVOTDATA resolution after rename. Existing PivotTableTests (range-copy path) remain green.

@swmal swmal self-assigned this Aug 6, 2026
@swmal swmal added the enhancement New feature or request label Aug 6, 2026
@swmal swmal changed the title #2455 - Addedgit status hook for naming copied pivot tables during worksheet copy #2455 - Added hook for naming copied pivot tables during worksheet copy Aug 6, 2026
@JanKallman
JanKallman merged commit 23a7474 into develop8 Aug 10, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this to Pending Release in Epplus Enhancements Aug 10, 2026
@JanKallman
JanKallman deleted the feature/i2455 branch August 10, 2026 05:55
JanKallman added a commit that referenced this pull request Aug 24, 2026
* #2455 - Addedgit status hook for naming copied pivot tables during worksheet copy (#2457)

* Base theme fallback system functional for borders

* Progress on reasoning on true fallback color

* Added check for applying tint. we do inverse

* A version that passes all test cases.Problem:Magic numbers

* Started adding a system with less magic numbers

* Ensured directory is created for tests

* Fixes issue 2459 (#2461)

* Fixes issue #2459. Fix for copying tables/pivottables within a worksheet.

* Fix for issue #2463

* Fix for issue #2463

* Cleaned up test

* Moved Range Dictionary lookup into SaveWorkbook in RpnFormulaExecute

* Fixed #2464 (#2467)

* Changed default shape shade to 15%

* Fixed positioning of primary and secondary axis and axis titles when setting position to low or high.

* Fixes more axis issues

* Fixes axis titles when deleted primary axis

* Fixed gradient.

* Fixed Tint/Shade transform calculation

* #2456-Removed Finalizers from the cell store and the ExcelVmlDrawingCollection

* fixed issue (#2475)

* #2456-Removed finalizers on cell store classes. (#2477)

* EPPlus version 8.7.0

* Fixed edge-case fallbacks to use new fix

* Fixed glow filter

* Implemented new fill fallbacks lotta stuff crashes

* Fixed null issue

* Fixes date axis label positioning

* Re-fixed smiley

* Started on each chart element providing style info

* Added new default chartDrawingObject

* Fixed multiple bugs in new system removed some of old

* Fixed failing tests

* Fixed edge-case node-exists but is empty

---------

Co-authored-by: Mats Alm <897655+swmal@users.noreply.github.com>
Co-authored-by: Ossian Edström <ossian.edstrom@epplussoftware.com>
Co-authored-by: OssianEPPlus <122265629+OssianEPPlus@users.noreply.github.com>
Co-authored-by: AdrianEPPlus <162118292+AdrianEPPlus@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Pending Release

Development

Successfully merging this pull request may close these issues.

2 participants