Supports nameing the PivotTable sheet created

This commit is contained in:
dfinke
2018-06-24 09:31:26 -04:00
parent fa887bbb24
commit 8052b56387

View File

@@ -341,6 +341,7 @@
[Int]$TitleSize = 22,
[System.Drawing.Color]$TitleBackgroundColor,
[Switch]$IncludePivotTable,
[String]$PivotTableName,
[String[]]$PivotRows,
[String[]]$PivotColumns,
$PivotData,
@@ -801,7 +802,8 @@
if ($IncludePivotTable -or $IncludePivotChart) {
#changed so -includePivotChart Implies -includePivotTable.
$pivotTableName = $WorkSheetname + 'PivotTable'
if (!$PivotTableName) { $pivotTableName = $WorkSheetname + 'PivotTable'}
#Make sure the Pivot table sheet doesn't already exist
try { $pkg.Workbook.Worksheets.Delete( $pivotTableName) } catch {}
$wsPivot = $pkg | Add-WorkSheet -WorkSheetname $pivotTableName -NoClobber:$NoClobber