Skip to main content

XRPivotGrid.RestoreLayoutFromStream(Stream, OptionsLayoutBase) Method

Restores a pivot grid’s layout from the specified stream, using the specified settings.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.1.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

public void RestoreLayoutFromStream(
    Stream stream,
    OptionsLayoutBase options
)

Parameters

Name Type Description
stream Stream

A Stream descendant which contains the layout settings. If null (Nothing in Visual Basic), an exception is raised.

options OptionsLayoutBase

A OptionsLayoutBase descendant which specifies which options should be restored.

Remarks

Use the RestoreLayoutFromStream method to load the pivot grid’s layout from the stream to which the layout was saved.

The options parameter determines which options should be restored from the stream. For a pivot grid control a OptionsLayoutGrid object can be created, customized as required and then passed as the options parameter. Only the options that are enabled in this object will be restored.

To restore all the options you can pass null or the static OptionsLayoutBase.FullLayout property as the options parameter.

The RestoreLayoutFromStream method overload without the options parameter restores only the options which are specified by the pivot grid’s XRPivotGrid.OptionsLayout property.

Example

The following sample code saves a Pivot Grid Control’s layout to a memory stream and then restores it.

System.IO.Stream stream;
stream = new System.IO.MemoryStream();
pivotGridControl1.SaveLayoutToStream(stream);
stream.Seek(0, System.IO.SeekOrigin.Begin);

// ...
pivotGridControl1.RestoreLayoutFromStream(stream);
stream.Seek(0, System.IO.SeekOrigin.Begin);
See Also