Back to Devexpress

PivotLayout.RepeatAllItemLabels(Boolean) Method

officefileapi-devexpress-dot-spreadsheet-dot-pivotlayout-dot-repeatallitemlabels-x28-system-dot-boolean-x29.md

latest6.9 KB
Original Source

PivotLayout.RepeatAllItemLabels(Boolean) Method

Specifies whether to repeat item labels for all outer row and column fields in a pivot table.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void RepeatAllItemLabels(
    bool repeat
)
vb
Sub RepeatAllItemLabels(
    repeat As Boolean
)

Parameters

NameTypeDescription
repeatBoolean

true , to repeat item labels in the outer fields; otherwise, false.

|

Remarks

If your PivotTable report contains multiple fields in the row or column area, you can specify how to display item labels in the outer row and column fields. By default, items of the outermost column and row fields are displayed only once, while items in the remaining column and row fields are repeated as needed. If you wish to repeat item labels in all outer row and column fields, call the RepeatAllItemLabels method.

|

Do Not Repeat Item Labels

(the default option)

|

Repeat All Item Labels

| | --- | --- | |

|

|

To repeat item labels in a particular field, use the field’s PivotFieldLayout.RepeatItemLabels property.

Note

Repeated labels for the outer row fields are displayed only when a pivot table is shown in outline or tabular form. To change the report layout, use the PivotLayout.SetReportLayout method.

Example

View Example

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

' Access the pivot table by its name in the collection.
Dim pivotTable As PivotTable = worksheet.PivotTables("PivotTable1")
' Display repeated column labels.
pivotTable.Layout.RepeatAllItemLabels(True)
csharp
Worksheet worksheet = workbook.Worksheets["Report5"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Access the pivot table by its name in the collection.
PivotTable pivotTable = worksheet.PivotTables["PivotTable1"];
// Display repeated column labels.
pivotTable.Layout.RepeatAllItemLabels(true);

The following code snippets (auto-collected from DevExpress Examples) contain references to the RepeatAllItemLabels(Boolean) 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/PivotTableLayoutActions.cs#L141

csharp
// Display repeated column labels.
pivotTable.Layout.RepeatAllItemLabels(true);
#endregion #RepeatAllItemLabels

winforms-spreadsheet-pivot-table-api/CS/SpreadsheetPivotTableExamples/CodeExamples/PivotTableLayoutActions.cs#L141

csharp
// Display repeated column labels.
pivotTable.Layout.RepeatAllItemLabels(true);
#endregion #RepeatAllItemLabels

spreadsheet-document-api-pivot-table-examples/CS/SpreadsheetDocServerPivotAPI/CodeExamples/PivotTableLayoutActions.cs#L155

csharp
// Display repeated column labels.
pivotTable.Layout.RepeatAllItemLabels(true);
#endregion #RepeatAllItemLabels

wpf-spreadsheet-pivot-table-api-examples/VB/SpreadsheetWPFPivotTableExamples/CodeExamples/PivotTableLayoutActions.vb#L133

vb
' Display repeated column labels.
            pivotTable.Layout.RepeatAllItemLabels(True)
' #End Region ' #RepeatAllItemLabels

winforms-spreadsheet-pivot-table-api/VB/SpreadsheetPivotTableExamples/CodeExamples/PivotTableLayoutActions.vb#L133

vb
' Display repeated column labels.
            pivotTable.Layout.RepeatAllItemLabels(True)
' #End Region ' #RepeatAllItemLabels

spreadsheet-document-api-pivot-table-examples/VB/SpreadsheetDocServerPivotAPI/CodeExamples/PivotTableLayoutActions.vb#L142

vb
' Display repeated column labels.
            pivotTable.Layout.RepeatAllItemLabels(True)
#End Region ' #RepeatAllItemLabels

See Also

RepeatItemLabels

PivotLayout Interface

PivotLayout Members

DevExpress.Spreadsheet Namespace