Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PivotGridControl.SavePivotGridToStream(Stream) Method

Saves the Pivot Grid Control’s data and full layout to the specified stream.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v24.2.dll

NuGet Package: DevExpress.Win.PivotGrid

#Declaration

public void SavePivotGridToStream(
    Stream stream
)

#Parameters

Name Type Description
stream Stream

A Stream descendant to which data is saved.

#Remarks

This method saves the original data that is provided by a data store to the specified stream. The data can be loaded later in the same grid control, or another, by creating a PivotFileDataSource object, and assigning it to the PivotGridControl.DataSource property. No connection to the original data store is required.

The SavePivotGridToStream method also saves the full layout along with the data to the stream. When the data is restored, the layout is restored as well, regardless of the layout settings specified by the PivotGridControl.OptionsLayout property.

Note

When creating a PivotFileDataSource object from a stream, do not dispose of the stream until the PivotFileDataSource object is assigned to the PivotGridControl.DataSource property.

Note

Saving PivotGrid’s data to a file or stream is not supported for Server Mode and OLAP data sources.

See Also