# GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.CreateFieldSettings

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_Commands_PivotTables_PivotTableCommand_CreateFieldSettings_" data-uid="GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.CreateFieldSettings*">CreateFieldSettings Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_Commands_PivotTables_PivotTableCommand_CreateFieldSettings_" data-uid="GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.CreateFieldSettings*"></a>
<h4 id="GrapeCity_Spreadsheet_Commands_PivotTables_PivotTableCommand_CreateFieldSettings_GrapeCity_Spreadsheet_PivotTables_IPivotTable_GrapeCity_Spreadsheet_PivotTables_IPivotField_System_String_GrapeCity_Spreadsheet_PivotTables_ConsolidationFunction_GrapeCity_Spreadsheet_PivotTables_PivotFieldCalculation_GrapeCity_Spreadsheet_NumberFormat_System_Nullable_System_Int32__System_Nullable_System_Int32__" data-uid="GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.CreateFieldSettings(GrapeCity.Spreadsheet.PivotTables.IPivotTable,GrapeCity.Spreadsheet.PivotTables.IPivotField,System.String,GrapeCity.Spreadsheet.PivotTables.ConsolidationFunction,GrapeCity.Spreadsheet.PivotTables.PivotFieldCalculation,GrapeCity.Spreadsheet.NumberFormat,System.Nullable{System.Int32},System.Nullable{System.Int32})">CreateFieldSettings(IPivotTable, IPivotField, string, ConsolidationFunction, PivotFieldCalculation, NumberFormat, int?, int?)</h4>
<div class="markdown level1 summary"><p>Initializes a new command to modify <span class="xref">GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.PivotTable</span> value field settings.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Command CreateFieldSettings(IPivotTable pivotTable, IPivotField pivotField, string customName, ConsolidationFunction function, PivotFieldCalculation calculation, NumberFormat numberFormat, int? baseField = null, int? baseItem = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function CreateFieldSettings(pivotTable As IPivotTable, pivotField As IPivotField, customName As String, [function] As ConsolidationFunction, calculation As PivotFieldCalculation, numberFormat As NumberFormat, Optional baseField As Integer? = Nothing, Optional baseItem As Integer? = Nothing) As Command</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotTable.html">IPivotTable</a></td>
      <td><span class="parametername">pivotTable</span></td>
      <td><p>The PivotTable report</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotField.html">IPivotField</a></td>
      <td><span class="parametername">pivotField</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">customName</span></td>
      <td><p>The custom name of the specified field.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.PivotTables.ConsolidationFunction.html">ConsolidationFunction</a></td>
      <td><span class="parametername">function</span></td>
      <td><p>A <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.ConsolidationFunction.html">ConsolidationFunction</a> value that represents the subtotal function of the specified field.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.PivotTables.PivotFieldCalculation.html">PivotFieldCalculation</a></td>
      <td><span class="parametername">calculation</span></td>
      <td><p>A <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.PivotFieldCalculation.html">PivotFieldCalculation</a> value that represents the type of calculation performed by the specified field.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.NumberFormat.html">NumberFormat</a></td>
      <td><span class="parametername">numberFormat</span></td>
      <td><p>The number format which indicate how to format and render the numeric value of a cell.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>?</td>
      <td><span class="parametername">baseField</span></td>
      <td><p>The base field for a custom calculation</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>?</td>
      <td><span class="parametername">baseItem</span></td>
      <td><p>The item in the base field for a custom calculation.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.Commands.Command.html">Command</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Spreadsheet_Commands_PivotTables_PivotTableCommand_CreateFieldSettings_" data-uid="GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.CreateFieldSettings*"></a>
<h4 id="GrapeCity_Spreadsheet_Commands_PivotTables_PivotTableCommand_CreateFieldSettings_GrapeCity_Spreadsheet_PivotTables_IPivotTable_System_Int32_System_String_System_Nullable_GrapeCity_Spreadsheet_PivotTables_ConsolidationFunction__System_Nullable_System_Boolean__System_Nullable_GrapeCity_Spreadsheet_PivotTables_LayoutFormType__System_Nullable_System_Boolean__System_Nullable_GrapeCity_Spreadsheet_PivotTables_SubtotalLocationType__System_Nullable_System_Boolean__System_Nullable_System_Boolean__System_Nullable_System_Boolean__System_String_" data-uid="GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.CreateFieldSettings(GrapeCity.Spreadsheet.PivotTables.IPivotTable,System.Int32,System.String,System.Nullable{GrapeCity.Spreadsheet.PivotTables.ConsolidationFunction},System.Nullable{System.Boolean},System.Nullable{GrapeCity.Spreadsheet.PivotTables.LayoutFormType},System.Nullable{System.Boolean},System.Nullable{GrapeCity.Spreadsheet.PivotTables.SubtotalLocationType},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.String)">CreateFieldSettings(IPivotTable, int, string, ConsolidationFunction?, bool?, LayoutFormType?, bool?, SubtotalLocationType?, bool?, bool?, bool?, string)</h4>
<div class="markdown level1 summary"><p>Initializes a new command to modify <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotTable.html">IPivotTable</a> field settings.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Command CreateFieldSettings(IPivotTable pivotTable, int fieldIndex, string customName = null, ConsolidationFunction? subtotals = null, bool? includeNewItemsInFilter = null, LayoutFormType? layoutForm = null, bool? layoutCompactRow = null, SubtotalLocationType? layoutSubtotalLocation = null, bool? repeatLabels = null, bool? layoutBlankLine = null, bool? showAllItems = null, string numberFormat = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function CreateFieldSettings(pivotTable As IPivotTable, fieldIndex As Integer, Optional customName As String = Nothing, Optional subtotals As ConsolidationFunction? = Nothing, Optional includeNewItemsInFilter As Boolean? = Nothing, Optional layoutForm As LayoutFormType? = Nothing, Optional layoutCompactRow As Boolean? = Nothing, Optional layoutSubtotalLocation As SubtotalLocationType? = Nothing, Optional repeatLabels As Boolean? = Nothing, Optional layoutBlankLine As Boolean? = Nothing, Optional showAllItems As Boolean? = Nothing, Optional numberFormat As String = Nothing) As Command</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotTable.html">IPivotTable</a></td>
      <td><span class="parametername">pivotTable</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">fieldIndex</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">customName</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.PivotTables.ConsolidationFunction.html">ConsolidationFunction</a>?</td>
      <td><span class="parametername">subtotals</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>?</td>
      <td><span class="parametername">includeNewItemsInFilter</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.PivotTables.LayoutFormType.html">LayoutFormType</a>?</td>
      <td><span class="parametername">layoutForm</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>?</td>
      <td><span class="parametername">layoutCompactRow</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.PivotTables.SubtotalLocationType.html">SubtotalLocationType</a>?</td>
      <td><span class="parametername">layoutSubtotalLocation</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>?</td>
      <td><span class="parametername">repeatLabels</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>?</td>
      <td><span class="parametername">layoutBlankLine</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>?</td>
      <td><span class="parametername">showAllItems</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">numberFormat</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.Commands.Command.html">Command</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
