The following example shows how to save the Pivot Grid Control’s data to a file, and then load it later.
To save the data the PivotGridControl.SavePivotGridToFile method is called. To restore the data, a PivotFileDataSource object is initialized and assigned to the PivotGridControl.DataSource property.
using DevExpress.Data.PivotGrid;
string filePath = "c:\\pivotData.dat";
// Save the control's data to the file.
pivotGridControl1.SavePivotGridToFile(filePath);
//...
// Restore the saved data
PivotFileDataSource ds = new PivotFileDataSource(filePath);
pivotGridControl1.DataSource = ds;
Imports DevExpress.Data.PivotGrid
Dim filePath As String = "c:\\pivotData.dat"
' Save the control's data to the file.
pivotGridControl1.SavePivotGridToFile(filePath)
'...
' Restore the saved data
Dim ds As PivotFileDataSource = New PivotFileDataSource(filePath)
pivotGridControl1.DataSource = ds