# GrapeCity.Spreadsheet.Slicers.ISlicerCaches.Add

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_Slicers_ISlicerCaches_Add_" data-uid="GrapeCity.Spreadsheet.Slicers.ISlicerCaches.Add*">Add Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_Slicers_ISlicerCaches_Add_" data-uid="GrapeCity.Spreadsheet.Slicers.ISlicerCaches.Add*"></a>
<h4 id="GrapeCity_Spreadsheet_Slicers_ISlicerCaches_Add_GrapeCity_Spreadsheet_ITable_System_String_System_String_System_Boolean_" data-uid="GrapeCity.Spreadsheet.Slicers.ISlicerCaches.Add(GrapeCity.Spreadsheet.ITable,System.String,System.String,System.Boolean)">Add(ITable, string, string, bool)</h4>
<div class="markdown level1 summary"><p>Adds a new <a class="xref" href="GrapeCity.Spreadsheet.Slicers.ISlicerCache.html">ISlicerCache</a> object 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">ISlicerCache Add(ITable table, string columnName, string name = null, bool create = true)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function Add(table As ITable, columnName As String, Optional name As String = Nothing, Optional create As Boolean = True) As ISlicerCache</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.ITable.html">ITable</a></td>
      <td><span class="parametername">table</span></td>
      <td><p>The data source that the new <a class="xref" href="GrapeCity.Spreadsheet.Slicers.ISlicerCache.html">ISlicerCache</a> will be based on.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">columnName</span></td>
      <td><p>The name of the column in the table to filter by.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">name</span></td>
      <td><p>The name Spread uses to reference the slicer cache (the value of the <a class="xref" href="GrapeCity.Spreadsheet.Slicers.ISlicerCache.Name.html#GrapeCity_Spreadsheet_Slicers_ISlicerCache_Name">Name</a> property). If omitted, Spread will generate a name.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">create</span></td>
      <td><p><code>true</code> to create new <a class="xref" href="GrapeCity.Spreadsheet.Slicers.ISlicerCache.html">ISlicerCache</a> object; otherwise, a corresponding <a class="xref" href="GrapeCity.Spreadsheet.Slicers.ISlicerCache.html">ISlicerCache</a> object is reused if it exists.</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.Slicers.ISlicerCache.html">ISlicerCache</a></td>
      <td><p>A <a class="xref" href="GrapeCity.Spreadsheet.Slicers.ISlicerCache.html">ISlicerCache</a> value represents the created slicer cache. <code>null</code> if the slicer cache cannot be created.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Spreadsheet_Slicers_ISlicerCaches_Add_" data-uid="GrapeCity.Spreadsheet.Slicers.ISlicerCaches.Add*"></a>
<h4 id="GrapeCity_Spreadsheet_Slicers_ISlicerCaches_Add_GrapeCity_Spreadsheet_ITable_System_Int32_System_String_System_Boolean_" data-uid="GrapeCity.Spreadsheet.Slicers.ISlicerCaches.Add(GrapeCity.Spreadsheet.ITable,System.Int32,System.String,System.Boolean)">Add(ITable, int, string, bool)</h4>
<div class="markdown level1 summary"><p>Adds a new <a class="xref" href="GrapeCity.Spreadsheet.Slicers.ISlicerCache.html">ISlicerCache</a> object 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">ISlicerCache Add(ITable table, int columnIndex, string name = null, bool create = true)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function Add(table As ITable, columnIndex As Integer, Optional name As String = Nothing, Optional create As Boolean = True) As ISlicerCache</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.ITable.html">ITable</a></td>
      <td><span class="parametername">table</span></td>
      <td><p>The data source that the new <a class="xref" href="GrapeCity.Spreadsheet.Slicers.ISlicerCache.html">ISlicerCache</a> will be based on.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">columnIndex</span></td>
      <td><p>The relative index of the column in the table to filter by.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">name</span></td>
      <td><p>The name Spread uses to reference the slicer cache (the value of the <a class="xref" href="GrapeCity.Spreadsheet.Slicers.ISlicerCache.Name.html#GrapeCity_Spreadsheet_Slicers_ISlicerCache_Name">Name</a> property). If omitted, Spread will generate a name.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">create</span></td>
      <td><p><code>true</code> to create new <a class="xref" href="GrapeCity.Spreadsheet.Slicers.ISlicerCache.html">ISlicerCache</a> object; otherwise, a corresponding <a class="xref" href="GrapeCity.Spreadsheet.Slicers.ISlicerCache.html">ISlicerCache</a> object is reused if it exists.</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.Slicers.ISlicerCache.html">ISlicerCache</a></td>
      <td><p>A <a class="xref" href="GrapeCity.Spreadsheet.Slicers.ISlicerCache.html">ISlicerCache</a> value represents the created slicer cache. <code>null</code> if the slicer cache cannot be created.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
