mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-15 15:53:32 +00:00
assume IncludePivot when implied by other params
This commit is contained in:
@@ -442,7 +442,7 @@
|
||||
Add-PivotTable -ExcelPackage $pkg -PivotTableName $item.key @Params
|
||||
}
|
||||
}
|
||||
if ($IncludePivotTable -or $IncludePivotChart) {
|
||||
if ($IncludePivotTable -or $IncludePivotChart -or $PivotData) {
|
||||
$params = @{
|
||||
'SourceRange' = $dataRange
|
||||
}
|
||||
@@ -461,7 +461,8 @@
|
||||
if ($NoTotalsInPivot) {$params.PivotTotals = "None" }
|
||||
Elseif ($PivotTotals) {$params.PivotTotals = $PivotTotals}
|
||||
if ($PivotDataToColumn) {$params.PivotDataToColumn = $true}
|
||||
if ($IncludePivotChart) {
|
||||
if ($IncludePivotChart -or
|
||||
$PSBoundParameters.ContainsKey('ChartType')) {
|
||||
$params.IncludePivotChart = $true
|
||||
$Params.ChartType = $ChartType
|
||||
if ($ShowCategory) {$params.ShowCategory = $true}
|
||||
|
||||
@@ -62,6 +62,9 @@ function New-PivotTableDefinition {
|
||||
$parameters.Remove('NoTotalsInPivot')
|
||||
$parameters["PivotTotals"] = "None"
|
||||
}
|
||||
if ($PSBoundParameters.ContainsKey('ChartType') -and -not $PSBoundParameters.ContainsKey('IncludePivotChart')) {
|
||||
$parameters['IncludePivotChart'] = $true
|
||||
}
|
||||
$parameters.Remove('PivotTableName')
|
||||
if ($PivotChartDefinition) {
|
||||
$parameters.PivotChartDefinition.XRange = $null
|
||||
|
||||
Reference in New Issue
Block a user