Background
When a worksheet containing pivot tables is copied within the same workbook, EPPlus renames each copied pivot table to a generated name (PivotTable1, PivotTable2, ...). There is currently no way for the caller to assign a meaningful name to a copied pivot table at copy time. Callers who need stable, per-instance names (e.g. stamping out per-market or per-period sheets from a template) must match generated names back to their originals afterwards, which is fragile.
Proposed change
Mirror the existing table copy hook: add a PivotTableCopyHandler to the worksheet copy options, invoked for each copied pivot table with the source name and the default assigned name, letting the caller supply a custom name. The rename routes through the ExcelPivotTable.Name setter so name uniqueness is validated. GETPIVOTDATA references are address based, so no formula adjustment is required.
Background
When a worksheet containing pivot tables is copied within the same workbook, EPPlus renames each copied pivot table to a generated name (
PivotTable1,PivotTable2, ...). There is currently no way for the caller to assign a meaningful name to a copied pivot table at copy time. Callers who need stable, per-instance names (e.g. stamping out per-market or per-period sheets from a template) must match generated names back to their originals afterwards, which is fragile.Proposed change
Mirror the existing table copy hook: add a
PivotTableCopyHandlerto the worksheet copy options, invoked for each copied pivot table with the source name and the default assigned name, letting the caller supply a custom name. The rename routes through theExcelPivotTable.Namesetter so name uniqueness is validated.GETPIVOTDATAreferences are address based, so no formula adjustment is required.