How to efficiently refresh multiple pivot tables that are configured to share one cache and use data from a table on a separate worksheet in the same workbook, after I programmatically update data in the table, before saving to PDF.
Currently, I do:
foreach (var ws in workbook.Worksheets) {
foreach (var pt in ws.PivotTables) {
pt.RefreshData();
pt.CalculateDate();
}
foreach (var ch in ws.Charts) {
ch.RefreshPivotData();
ch.Calculate();
}
}
workbook.Save("report.pdf", new PdfSaveOptions {CalculateFormula=true});
If I understand correctly, RefreshData and RefreshPivotData update the cache with current data from the table, and since there is only one share cache, the cache is unnecessary refreshed multiple times.
I didn’t find API to access the cache directly. How can I identify and update the cache only once using Aspose.Cells API?
Thanks