qax-os / excelize

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
https://xuri.me/excelize
BSD 3-Clause "New" or "Revised" License
18.16k stars 1.71k forks source link

PivotTable: Refresh cache of PivotTable(s) #597

Open mvanwaaijen opened 4 years ago

mvanwaaijen commented 4 years ago

As of now, you can only add a new pivot table with the AddPivotTable function and not reference an existing pivot table. I am looking for a way to refresh the cache of the pivottable for instance by calling a RefreshPivotTables() function or something like that to refresh the cache when the underlying data an existing pivot table has been changed...

SVilgelm commented 4 years ago

@xuri D you have any ideas how to refresh the pivot tables? I can implement it, but I need some hints where to start. I really need this feature and will be glad if to get it in next release

SVilgelm commented 4 years ago

@mvanwaaijen Do you know any other go libraries, that can work with pivot tables?

I need to edit an excel file, that contains the pivot tables, and after the saving I would like to see the updated pivot tables.

drsasa commented 4 years ago

@SVilgelm For now you can have your templates checked 'Refresh data when opening the file'. That way when you save changed excel file through code, when you open it with Excel will be automatic refreshed.

SVilgelm commented 4 years ago

@drsasa thank you!

mvanwaaijen commented 4 years ago

@mvanwaaijen Do you know any other go libraries, that can work with pivot tables?

I need to edit an excel file, that contains the pivot tables, and after the saving I would like to see the updated pivot tables.

I see there is already a solution. I am not aware of any other packages that can do all this...