The requested page is not available for the requested platform. You are viewing the content for Default platform.

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.v19.1.dll


public void RestoreLayoutFromStream(
    Stream stream,
    OptionsLayoutBase options
Public Sub RestoreLayoutFromStream(
    stream As Stream,
    options As OptionsLayoutBase


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.


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.


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();
stream.Seek(0, System.IO.SeekOrigin.Begin);

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