# GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.Filter

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_Commands_PivotTables_PivotTableCommand_Filter_" data-uid="GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.Filter*">Filter Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_Commands_PivotTables_PivotTableCommand_Filter_" data-uid="GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.Filter*"></a>
<h4 id="GrapeCity_Spreadsheet_Commands_PivotTables_PivotTableCommand_Filter_GrapeCity_Spreadsheet_PivotTables_IPivotTable_System_Int32_GrapeCity_Spreadsheet_IndexBitmap_" data-uid="GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.Filter(GrapeCity.Spreadsheet.PivotTables.IPivotTable,System.Int32,GrapeCity.Spreadsheet.IndexBitmap)">Filter(IPivotTable, int, IndexBitmap)</h4>
<div class="markdown level1 summary"><p>Initializes a new command to filter the <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotTable.html">IPivotTable</a> by a specific <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotField.html">IPivotField</a>.</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 Filter(IPivotTable pivotTable, int pivotFieldIndex, IndexBitmap visibleItemsList)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Filter(pivotTable As IPivotTable, pivotFieldIndex As Integer, visibleItemsList As IndexBitmap) 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 <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotTable.html">IPivotTable</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">pivotFieldIndex</span></td>
      <td><p>The index of <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotField.html">IPivotField</a></p>
</td>
    </tr>
    <tr>
      <td><span class="xref">IndexBitmap</span></td>
      <td><span class="parametername">visibleItemsList</span></td>
      <td><p>The array of the visible indexes.</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><p>A filter command.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Spreadsheet_Commands_PivotTables_PivotTableCommand_Filter_" data-uid="GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.Filter*"></a>
<h4 id="GrapeCity_Spreadsheet_Commands_PivotTables_PivotTableCommand_Filter_GrapeCity_Spreadsheet_PivotTables_IPivotTable_System_Int32_GrapeCity_Spreadsheet_PivotTables_PivotFilterType_System_Object_System_Object_System_Int32_System_Boolean_" data-uid="GrapeCity.Spreadsheet.Commands.PivotTables.PivotTableCommand.Filter(GrapeCity.Spreadsheet.PivotTables.IPivotTable,System.Int32,GrapeCity.Spreadsheet.PivotTables.PivotFilterType,System.Object,System.Object,System.Int32,System.Boolean)">Filter(IPivotTable, int, PivotFilterType, object, object, int, bool)</h4>
<div class="markdown level1 summary"><p>Initializes a new command to filter the <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotTable.html">IPivotTable</a> by a specific <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotField.html">IPivotField</a> with specified criteria.</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 Filter(IPivotTable pivotTable, int pivotFieldIndex, PivotFilterType type, object criteria1 = null, object criteria2 = null, int dataFieldPosition = -1, bool wholeDays = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Filter(pivotTable As IPivotTable, pivotFieldIndex As Integer, type As PivotFilterType, Optional criteria1 As Object = Nothing, Optional criteria2 As Object = Nothing, Optional dataFieldPosition As Integer = -1, Optional wholeDays As Boolean = False) 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 <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotTable.html">IPivotTable</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">pivotFieldIndex</span></td>
      <td><p>The index of <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.IPivotField.html">IPivotField</a></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.PivotTables.PivotFilterType.html">PivotFilterType</a></td>
      <td><span class="parametername">type</span></td>
      <td><p>The type of filter in a PivotTable</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">criteria1</span></td>
      <td><p>filter value 1.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">criteria2</span></td>
      <td><p>filter value 2.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">dataFieldPosition</span></td>
      <td><p>The field to which the filter is attached.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">wholeDays</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><p>A filter command.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
