Skip to main content
A newer version of this page is available. .

PivotGridControl.SavePivotGridToStream(Stream) Method

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

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v18.2.dll

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.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SavePivotGridToStream(Stream) 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.

See Also