Removes all fields, formatting and report filters from the PivotTable report.
The Clear method does not delete the pivot table, but resets it to the initial state, before any fields were added to it. The data connection, PivotTable cache and the report location are preserved.
If the pivot table you wish to clear is based on the same data as other pivot tables in a document, the Clear method will also remove grouping, calculated fields, and calculated items from other shared PivotTable reports.
Dim worksheet As Worksheet = workbook.Worksheets("Report1") workbook.Worksheets.ActiveWorksheet = worksheet ' Clear the pivot table. worksheet.PivotTables("PivotTable1").Clear()
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the Clear() method.
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.