[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotField.Name

Name Property

Name

Gets or sets the name of the object.

Use this property to retrieve the current name of a field in a PivotTable report.

Declaration
string Name { get; set; }
Property Name As String
Examples
worksheet.Range["A1:B4"].Value = new object[,] {
    {"Category", "Amount"},
    {"Fruit", 120},
    {"Drink", 50},
    {"Fruit", 80}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "SalesPivot");
IPivotField field = pivotTable.PivotFields["Category"];
field.Name = "Product Category";
string name = field.Name;