AutoLayout Method

Microsoft Office Web Components Visual Basic

Resets the specified PivotTable list to a default view configuration. If the PivotTable is bound to a recordset, a field set is added to the data axis for each field in the recordset. If the PivotTable is bound to an multidimensional data source, such as an OLAP cube, all field sets are removed from the axes, clearing the current view.

expression.AutoLayout(MaxDataFields)

expression    An expression that returns a PivotView object.

MaxDataFields    Optional Long. Specifies the maximum number of fields that can be added to the data axis if the data member is a recordset. If this argument is not specified or is zero (0), there is no limit to the number of fields that will be added.

Example

This example resets the active view for PivotTable1.

PivotTable1.ActiveView.AutoLayout