Udostępnij za pośrednictwem


Chart.PivotLayout Property (2007 System)

Gets a PivotLayout object that represents the placement of fields in a PivotTable report and the placement of axes in a PivotChart report.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property PivotLayout As PivotLayout
'Usage
Dim instance As Chart 
Dim value As PivotLayout 

value = instance.PivotLayout
[BrowsableAttribute(false)]
public PivotLayout PivotLayout { get; }
[BrowsableAttribute(false)]
public:
property PivotLayout^ PivotLayout {
    PivotLayout^ get ();
}
public function get PivotLayout () : PivotLayout

Property Value

Type: PivotLayout
A PivotLayout object that represents the placement of fields in a PivotTable report and the placement of axes in a PivotChart report.

Remarks

If the Chart control you specify is not a PivotChart report, the value of this property is nulla null reference (Nothing in Visual Basic).

Examples

The following code example sets the current page for an existing PivotChart to the page named "Canada." This example assumes that the current worksheet contains a Chart named pivotChart1 that is a PivotChart report.

Private Sub ChangePivotFieldPage()
    If pivotChart1.PivotLayout Is Nothing Then
        MsgBox("The specified chart is not a pivot chart.")
    Else 
        Dim countryField As Excel.PivotField = _
            CType(pivotChart1.PivotLayout.PivotTable.PivotFields("Country"), _
             Excel.PivotField)
        countryField.CurrentPage = "Canada" 
    End If 
End Sub
private void ChangePivotFieldPage()
{
    if (pivotChart1.PivotLayout == null)
    {
        MessageBox.Show("The specified chart is not a pivot chart.");
    }
    else
    {
        Excel.PivotField countryField =
            (Excel.PivotField)pivotChart1.PivotLayout.
            PivotTable.PivotFields("Country");
        countryField.CurrentPage = "Canada";
    }
}

.NET Framework Security

See Also

Reference

Chart Class

Chart Members

Microsoft.Office.Tools.Excel Namespace