[]
Gets the field name as it appears in the original source data.
This value identifies the underlying source field for the PivotTable report. It can differ from the current display name returned by Name if the field has been renamed by using Name.
string SourceName { get; }
ReadOnly Property SourceName As String
object[,] sourceData = new object[,] {
{"Product", "Amount"},
{"Apple", 100},
{"Pear", 200}
};
worksheet.Range["G1:H3"].Value = sourceData;
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["G1:H3"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["A1"], "PivotTable1");
IPivotField field = pivotTable.PivotFields["Product"];
field.Name = "Item";
string sourceName = field.SourceName;