Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating ONLY pivot table #1668

Open
Stephanevg opened this issue Feb 3, 2025 · 3 comments
Open

Creating ONLY pivot table #1668

Stephanevg opened this issue Feb 3, 2025 · 3 comments

Comments

@Stephanevg
Copy link

Stephanevg commented Feb 3, 2025

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

@dfinke
Copy link
Owner

dfinke commented Feb 4, 2025

See if one these helps.

https://github.com/dfinke/ImportExcel/tree/master/Examples/PivotTable

@Stephanevg
Copy link
Author

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 ?

@dfinke
Copy link
Owner

dfinke commented Feb 6, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants