# GrapeCity.Documents.Excel.IPivotTable.Update

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Excel_IPivotTable_Update_" data-uid="GrapeCity.Documents.Excel.IPivotTable.Update*">Update Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Excel_IPivotTable_Update_" data-uid="GrapeCity.Documents.Excel.IPivotTable.Update*"></a>
<h4 id="GrapeCity_Documents_Excel_IPivotTable_Update" data-uid="GrapeCity.Documents.Excel.IPivotTable.Update">Update()</h4>
<div class="markdown level1 summary"><p>Updates the PivotTable report layout and displayed results.</p>
<p>
A common use case is to enable <a class="xref" href="GrapeCity.Documents.Excel.IPivotTable.DeferLayoutUpdate.html#GrapeCity_Documents_Excel_IPivotTable_DeferLayoutUpdate">DeferLayoutUpdate</a>, make multiple layout
changes, and then call this method once to apply them.
</p><p>
This method does not refresh the PivotCache from the source data. If the source data
has changed and the PivotCache must be refreshed first, call <a class="xref" href="GrapeCity.Documents.Excel.IPivotTable.Refresh.html#GrapeCity_Documents_Excel_IPivotTable_Refresh">Refresh()</a>
instead.
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void Update()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub Update()</code></pre>
</div>
<h5 id="GrapeCity_Documents_Excel_IPivotTable_Update_examples">Examples</h5>
<pre><code class="lang-csharp">worksheet.Range["A1:C5"].Value = new object[,] {
    {"Category", "Product", "Amount"},
    {"Beverages", "Tea", 100},
    {"Beverages", "Coffee", 200},
    {"Snacks", "Biscuits", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C5"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "PivotTable1");
pivotTable.DeferLayoutUpdate = true;
pivotTable.PivotFields["Category"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Amount"].Orientation = PivotFieldOrientation.DataField;
pivotTable.Update();</code></pre>

</div>
