# ExcelPivotFieldOptions

Describes formatting and display options for a pivot source field.

Class 

`OfficeIMO.Excel`

**Namespace**

`OfficeIMO.Excel`

**Assembly**

`OfficeIMO.Excel`

**Source revision**

`273d35d5ba8a` with working tree changes

**Source**

[ExcelPivotFieldOptions.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L28)

**Modifiers**

sealed

Describes formatting and display options for a pivot source field.

## Inheritance

- object
- ExcelPivotFieldOptions

## Usage

Explore 4 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 4

- Method [ExcelPivotFieldOptions.HideItems](/api/excel/officeimo-excel-excelpivotfieldoptions/#method-hideitems-string-string)
- Method [ExcelPivotFieldOptions.SelectPageItem](/api/excel/officeimo-excel-excelpivotfieldoptions/#method-selectpageitem-string-string)
- Method [ExcelPivotFieldOptions.ShowOnlyItems](/api/excel/officeimo-excel-excelpivotfieldoptions/#method-showonlyitems-string-string)
- Property [ExcelPivotTableOptions.FieldOptions](/api/excel/officeimo-excel-excelpivottableoptions/#property-fieldoptions)

Filter members 

Show inherited

## Constructors

`public ExcelPivotFieldOptions(string fieldName, ExcelPivotFieldSort? sortType = null, uint? numberFormatId = null, string? numberFormat = null, bool? showAll = null, bool? defaultSubtotal = null, bool? subtotalTop = null, bool? insertBlankRow = null, bool? insertPageBreak = null, bool? compact = null, bool? outline = null, bool? showDropDowns = null, bool? multipleItemSelectionAllowed = null, bool? includeNewItemsInFilter = null, string? subtotalCaption = null, IEnumerable<string>? hiddenItems = null, IEnumerable<string>? visibleItems = null, string? selectedItem = null)` [#](#member-33d6c5f36f1c2265b28970d2)

[ExcelPivotFieldOptions.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L28)

Creates pivot field options for a source field.

Parameters

**fieldName string required**

Header name from the source range.

**sortType OfficeIMO.Excel.ExcelPivotFieldSort? = null optional**

Optional pivot field sort mode.

**numberFormatId uint? = null optional**

Optional number format id to apply to the pivot field.

**numberFormat string? = null optional**

Optional number format code to apply to the pivot field.

**showAll bool? = null optional**

Whether to show all items for the pivot field.

**defaultSubtotal bool? = null optional**

Whether to use the default subtotal for the pivot field.

**subtotalTop bool? = null optional**

Whether subtotals should be shown at the top.

**insertBlankRow bool? = null optional**

Whether to insert a blank row after each item.

**insertPageBreak bool? = null optional**

Whether to insert a page break after each item.

**compact bool? = null optional**

Whether compact layout is enabled for this field.

**outline bool? = null optional**

Whether outline layout is enabled for this field.

**showDropDowns bool? = null optional**

Whether field drop-downs are shown.

**multipleItemSelectionAllowed bool? = null optional**

Whether multiple filter item selection is allowed.

**includeNewItemsInFilter bool? = null optional**

Whether new source items are included in the filter by default.

**subtotalCaption string? = null optional**

Optional custom subtotal caption.

**hiddenItems System.Collections.Generic.IEnumerable<string>? = null optional**

Optional source item captions to hide.

**visibleItems System.Collections.Generic.IEnumerable<string>? = null optional**

Optional source item captions to show; other known items are hidden.

**selectedItem string? = null optional**

Optional page-field item caption to select.

## Methods

`public static ExcelPivotFieldOptions HideItems(string fieldName, params string[] items)` [#](#method-hideitems-string-string)

[ExcelPivotFieldOptions.cs:162](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L162)

Creates field options that hide the specified source item captions.

Parameters

**fieldName string required**

**items string[] required**

Returns

`ExcelPivotFieldOptions`

`public static ExcelPivotFieldOptions SelectPageItem(string fieldName, string item)` [#](#method-selectpageitem-string-string)

[ExcelPivotFieldOptions.cs:170](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L170)

Creates field options that select an item for a page/filter field.

Parameters

**fieldName string required**

**item string required**

Returns

`ExcelPivotFieldOptions`

`public static ExcelPivotFieldOptions ShowOnlyItems(string fieldName, params string[] items)` [#](#method-showonlyitems-string-string)

[ExcelPivotFieldOptions.cs:166](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L166)

Creates field options that show only the specified source item captions.

Parameters

**fieldName string required**

**items string[] required**

Returns

`ExcelPivotFieldOptions`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public string FieldName { get; }` [#](#property-fieldname)

[ExcelPivotFieldOptions.cs:73](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L73)

Gets the source field name.

`public ExcelPivotFieldSort? SortType { get; }` [#](#property-sorttype)

[ExcelPivotFieldOptions.cs:78](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L78)

Gets the optional pivot field sort mode.

`public uint? NumberFormatId { get; }` [#](#property-numberformatid)

[ExcelPivotFieldOptions.cs:83](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L83)

Gets the optional number format id.

`public string? NumberFormat { get; }` [#](#property-numberformat)

[ExcelPivotFieldOptions.cs:88](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L88)

Gets the optional number format code.

`public bool? ShowAll { get; }` [#](#property-showall)

[ExcelPivotFieldOptions.cs:93](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L93)

Gets whether all items should be shown for the field.

`public bool? DefaultSubtotal { get; }` [#](#property-defaultsubtotal)

[ExcelPivotFieldOptions.cs:98](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L98)

Gets whether the default subtotal should be used.

`public bool? SubtotalTop { get; }` [#](#property-subtotaltop)

[ExcelPivotFieldOptions.cs:103](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L103)

Gets whether subtotals should be shown at the top.

`public bool? InsertBlankRow { get; }` [#](#property-insertblankrow)

[ExcelPivotFieldOptions.cs:108](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L108)

Gets whether to insert a blank row after each item.

`public bool? InsertPageBreak { get; }` [#](#property-insertpagebreak)

[ExcelPivotFieldOptions.cs:113](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L113)

Gets whether to insert a page break after each item.

`public bool? Compact { get; }` [#](#property-compact)

[ExcelPivotFieldOptions.cs:118](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L118)

Gets whether compact layout is enabled for this field.

`public bool? Outline { get; }` [#](#property-outline)

[ExcelPivotFieldOptions.cs:123](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L123)

Gets whether outline layout is enabled for this field.

`public bool? ShowDropDowns { get; }` [#](#property-showdropdowns)

[ExcelPivotFieldOptions.cs:128](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L128)

Gets whether field drop-downs are shown.

`public bool? MultipleItemSelectionAllowed { get; }` [#](#property-multipleitemselectionallowed)

[ExcelPivotFieldOptions.cs:133](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L133)

Gets whether multiple item selection is allowed.

`public bool? IncludeNewItemsInFilter { get; }` [#](#property-includenewitemsinfilter)

[ExcelPivotFieldOptions.cs:138](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L138)

Gets whether new source items are included in the filter by default.

`public string? SubtotalCaption { get; }` [#](#property-subtotalcaption)

[ExcelPivotFieldOptions.cs:143](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L143)

Gets the optional custom subtotal caption.

`public IReadOnlyList<string> HiddenItems { get; }` [#](#property-hiddenitems)

[ExcelPivotFieldOptions.cs:148](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L148)

Gets source item captions to hide. An empty caption selects a blank; whitespace is literal.

`public IReadOnlyList<string> VisibleItems { get; }` [#](#property-visibleitems)

[ExcelPivotFieldOptions.cs:153](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L153)

Gets source item captions to show; other known items are hidden. An empty caption selects a blank; whitespace is literal.

`public string? SelectedItem { get; }` [#](#property-selecteditem)

[ExcelPivotFieldOptions.cs:158](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotFieldOptions.cs#L158)

Gets the selected page-field item caption. Null leaves it unselected; an empty caption selects a blank.

<!-- PowerForge markdown artifact sha256:C41C3E320C0611F43ADFCF82E4C511E30008894A13C501B0DD1B645E7FC3E9A9 -->
