# GrapeCity.Documents.Excel.IPivotItem.Caption

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Excel_IPivotItem_Caption_" data-uid="GrapeCity.Documents.Excel.IPivotItem.Caption*">Caption Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Excel_IPivotItem_Caption_" data-uid="GrapeCity.Documents.Excel.IPivotItem.Caption*"></a>
<h4 id="GrapeCity_Documents_Excel_IPivotItem_Caption" data-uid="GrapeCity.Documents.Excel.IPivotItem.Caption">Caption</h4>
<div class="markdown level1 summary"><p>Gets or sets the display caption override for the PivotItem. A <code><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a></code> value clears the override.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">string Caption { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Property Caption As String</code></pre>
</div>
<h5 id="GrapeCity_Documents_Excel_IPivotItem_Caption_examples">Examples</h5>
<pre><code class="lang-csharp">Workbook workbook = new Workbook();
IWorksheet worksheet = workbook.Worksheets[0];
worksheet.Range["A1:C5"].Value = new object[,]
{
    { "Product", "Region", "Amount" },
    { "Apple", "East", 10 },
    { "Banana", "West", 20 },
    { "Carrot", "East", 30 },
    { "Date", "West", 40 }
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C5"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "PivotTable1");
pivotTable.PivotFields["Product"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Amount"].Orientation = PivotFieldOrientation.DataField;
IPivotItem item = pivotTable.PivotFields["Product"].PivotItems["Apple"];
item.Caption = "Fresh Apple";
string caption = item.Caption;</code></pre>

</div>
