[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotCache.Refresh

Refresh Method

Refresh()

Updates the PivotTable cache from its source data.

Use this method after changing the cache source range to reload the cached records used by PivotTable reports that are based on this IPivotCache.

Declaration
void Refresh()
Sub Refresh()
Examples
worksheet.Range["A1:B3"].Value = new object[,] {{"Region", "Sales"}, {"East", 120}, {"West", 150}};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B3"]);
pivotCache.CreatePivotTable(worksheet.Range["D1"]);
worksheet.Range["B3"].Value = 180;
pivotCache.Refresh();
Exceptions
Type Condition
InvalidOperationException

if the source sheet of the PivotCache cannot be found.