dfinke/ImportExcel

Creating ONLY pivot table

Stephanevg opened this issue · 4 comments

Hi all

I wanted to create ONLY a pivot table without a graph, but it

The blow creates the table, but without the pivot table.

$AllPageDetails | Select-Object ReleaseName, ReleaseVersion, GPO, Version, DeploymentMethod, Details | Export-Excel -Path $FilePath -Show -AutoSize -AutoFilter -FreezeTopRow -WorksheetName "ReleaseNotes" -PivotTableName "Data" -PivotRows "ReleaseVersion", "GPO", "Details"

The only way I found to add the pivot, is to add a graph to it using the following command.

$AllPageDetails | Select-Object ReleaseName, ReleaseVersion, GPO, Version, DeploymentMethod, Details | Export-Excel -Path $FilePath -Show -AutoSize -AutoFilter -FreezeTopRow -WorksheetName "ReleaseNotes" -PivotTableName "Data" -PivotRows "ReleaseVersion", "GPO", "Details" -IncludePivotChart

I then see another tab called 'data' with my pivot table on, but I also have this graph, which is not usable to me, and I frankly don't want.

Do you see something that I might be doing wrong ?

Cheers

Thanks for the feedback. Indeed, the fix was to use the switch -IncludePivotTable. I saw it in some examples, but when I tried tabbing it, the parameter never showed up. I basically assumed that this parameter was removed.

Looking closer at it, it has been marked as 'DontShow' here https://github.com/dfinke/ImportExcel/blob/dc4a5e9db989732697875dcca5aedff2ecbf3005/Public/Export-Excel.ps1#L25C9-L25C38

Do you know if Is this done on purpose ?

That was years ago, in a land far far away.

What happens if you use -PivotTableName <nameIt> instead. The params were being tweaked because -IncludePivotTable named the sheet and the other param let's you name it.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.