# GrapeCity.Spreadsheet.PivotTables.IPivotFilters.Add

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_PivotTables_IPivotFilters_Add_" data-uid="GrapeCity.Spreadsheet.PivotTables.IPivotFilters.Add*">Add Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_PivotTables_IPivotFilters_Add_" data-uid="GrapeCity.Spreadsheet.PivotTables.IPivotFilters.Add*"></a>
<h4 id="GrapeCity_Spreadsheet_PivotTables_IPivotFilters_Add_GrapeCity_Spreadsheet_PivotTables_PivotFilterType_System_Int32_System_Object_System_Object_System_Nullable_System_Boolean__" data-uid="GrapeCity.Spreadsheet.PivotTables.IPivotFilters.Add(GrapeCity.Spreadsheet.PivotTables.PivotFilterType,System.Int32,System.Object,System.Object,System.Nullable{System.Boolean})">Add(PivotFilterType, int, object, object, bool?)</h4>
<div class="markdown level1 summary"><p>Adds a new filter to the collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">IPivotFilter Add(PivotFilterType type, int dataFieldIndex = -1, object value1 = null, object value2 = null, bool? wholeDayFilter = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function Add(type As PivotFilterType, Optional dataFieldIndex As Integer = -1, Optional value1 As Object = Nothing, Optional value2 As Object = Nothing, Optional wholeDayFilter As Boolean? = Nothing) As IPivotFilter</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.PivotFilterType.html">PivotFilterType</a></td>
      <td><span class="parametername">type</span></td>
      <td><p>The <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.PivotFilterType.html">PivotFilterType</a> type of filter.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">dataFieldIndex</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">value1</span></td>
      <td><p>The first filter value.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">value2</span></td>
      <td><p>The second filter value.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>?</td>
      <td><span class="parametername">wholeDayFilter</span></td>
      <td><p>Specifies a filter based on days.</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.PivotTables.IPivotFilter.html">IPivotFilter</a></td>
      <td><p>An <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotFilter.html">IPivotFilter</a> object.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
