Back to Devexpress

PivotFieldReferenceBase.MoveDown() Method

officefileapi-devexpress-dot-spreadsheet-dot-pivotfieldreferencebase.md

latest6.4 KB
Original Source

PivotFieldReferenceBase.MoveDown() Method

Moves the field to the next position within the collection which represents the PivotTable area where this field is currently shown.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void MoveDown()
vb
Sub MoveDown

Remarks

After you create a PivotTable report or load an existing pivot table, you can rearrange fields shown in a specific area of the PivotTable report. To do this, access the required field you wish to move by its name in the collection representing the appropriate PivotTable area where this field is currently shown, and then call one of the following PivotFieldReferenceBase methods.

MethodDescription
PivotFieldReferenceBase.MoveUpMoves the field one position up in the area.
MoveDownMoves the field one position down in the area.
PivotFieldReferenceBase.MoveToBeginningMoves the field to the beginning of the area.
PivotFieldReferenceBase.MoveToEndMoves the field to the end of the area.

The example below demonstrates how to move the row field one position down in the row axis area.

View Example

vb
Dim worksheet As Worksheet = workbook.Worksheets("Report3")
workbook.Worksheets.ActiveWorksheet = worksheet

' Access the pivot table by its name in the collection.
Dim pivotTable As PivotTable = worksheet.PivotTables("PivotTable1")

' Move the "Region" field one position down in the row area.
pivotTable.RowFields("Region").MoveDown()
csharp
Worksheet worksheet = workbook.Worksheets["Report3"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Access the pivot table by its name in the collection.
PivotTable pivotTable = worksheet.PivotTables["PivotTable1"];

// Move the "Region" field one position down in the row area.
pivotTable.RowFields["Region"].MoveDown();

The following code snippets (auto-collected from DevExpress Examples) contain references to the MoveDown() 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.

wpf-spreadsheet-pivot-table-api-examples/CS/SpreadsheetWPFPivotTableExamples/CodeExamples/PivotFieldActions.cs#L83

csharp
// Move the "Region" field one position down in the row area.
pivotTable.RowFields["Region"].MoveDown();
#endregion #MoveDown

winforms-spreadsheet-pivot-table-api/CS/SpreadsheetPivotTableExamples/CodeExamples/PivotFieldActions.cs#L82

csharp
// Move the "Region" field one position down in the row area.
pivotTable.RowFields["Region"].MoveDown();
#endregion #MoveDown

spreadsheet-document-api-pivot-table-examples/CS/SpreadsheetDocServerPivotAPI/CodeExamples/PivotFieldActions.cs#L94

csharp
// Move the "Region" field one position down in the row area.
pivotTable.RowFields["Region"].MoveDown();
#endregion #MoveDown

wpf-spreadsheet-pivot-table-api-examples/VB/SpreadsheetWPFPivotTableExamples/CodeExamples/PivotFieldActions.vb#L80

vb
' Move the "Region" field one position down in the row area.
            pivotTable.RowFields("Region").MoveDown()
' #End Region ' #MoveDown

winforms-spreadsheet-pivot-table-api/VB/SpreadsheetPivotTableExamples/CodeExamples/PivotFieldActions.vb#L79

vb
' Move the "Region" field one position down in the row area.
            pivotTable.RowFields("Region").MoveDown()
' #End Region ' #MoveDown

spreadsheet-document-api-pivot-table-examples/VB/SpreadsheetDocServerPivotAPI/CodeExamples/PivotFieldActions.vb#L87

vb
' Move the "Region" field one position down in the row area.
            pivotTable.RowFields("Region").MoveDown()
#End Region ' #MoveDown

See Also

PivotFieldReferenceBase Interface

PivotFieldReferenceBase Members

DevExpress.Spreadsheet Namespace