Back to Devexpress

PivotCache.Refresh() Method

officefileapi-devexpress-dot-spreadsheet-dot-pivotcache-da090ef0.md

latest5.0 KB
Original Source

PivotCache.Refresh() Method

Refreshes the PivotTable cache to get the latest data from the data source.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void Refresh()
vb
Sub Refresh

Remarks

Use the Refresh method to refresh a pivot table after the source data was changed to ensure that the latest data appears in your report.

csharp
// Access the pivot table in the collection.
PivotTable pivotTable = worksheet.PivotTables["PivotTable1"];
// Refresh the pivot table.
pivotTable.Cache.Refresh();
vb
' Access the pivot table in the collection.
Dim pivotTable As PivotTable = worksheet.PivotTables("PivotTable1")
' Refresh the pivot table.
pivotTable.Cache.Refresh()

When you refresh a pivot table, all the pivot tables that are based on the same cache are also refreshed.

Call the PivotCacheCollection.RefreshAll method to refresh all PivotTable caches in a workbook.

Use the following properties to determine who and when refreshed a pivot table last time:

The following code snippets (auto-collected from DevExpress Examples) contain references to the Refresh() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-spreadsheet-pivot-table-api-examples/CS/SpreadsheetWPFPivotTableExamples/CodeExamples/PivotTableActions.cs#L77

csharp
// Refresh the pivot table.
worksheet.PivotTables["PivotTable1"].Cache.Refresh();

winforms-spreadsheet-pivot-table-api/CS/SpreadsheetPivotTableExamples/CodeExamples/PivotTableActions.cs#L72

csharp
// Refresh the pivot table.
worksheet.PivotTables["PivotTable1"].Cache.Refresh();

spreadsheet-document-api-pivot-table-examples/CS/SpreadsheetDocServerPivotAPI/CodeExamples/PivotTableActions.cs#L82

csharp
// Refresh the pivot table.
worksheet.PivotTables["PivotTable1"].Cache.Refresh();

wpf-spreadsheet-pivot-table-api-examples/VB/SpreadsheetWPFPivotTableExamples/CodeExamples/PivotTableActions.vb#L75

vb
' Refresh the pivot table.
worksheet.PivotTables("PivotTable1").Cache.Refresh()

winforms-spreadsheet-pivot-table-api/VB/SpreadsheetPivotTableExamples/CodeExamples/PivotTableActions.vb#L70

vb
' Refresh the pivot table.
worksheet.PivotTables("PivotTable1").Cache.Refresh()

spreadsheet-document-api-pivot-table-examples/VB/SpreadsheetDocServerPivotAPI/CodeExamples/PivotTableActions.vb#L75

vb
' Refresh the pivot table.
            worksheet.PivotTables("PivotTable1").Cache.Refresh()
#End Region ' #ChangeLocation

See Also

RefreshAll()

PivotCache Interface

PivotCache Members

DevExpress.Spreadsheet Namespace