[]
Gets the range that contains the entire PivotTable report, excluding page fields.
Use this property to access the rendered PivotTable area without including any page field region that is displayed separately from the main report.
IRange TableRange1 { get; }
ReadOnly Property TableRange1 As IRange
worksheet.Range["A1:B4"].Value = new object[,] {
{"Category", "Amount"},
{"Fruit", 100},
{"Fruit", 200},
{"Vegetable", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "SalesPivot");
pivotTable.PivotFields["Category"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Amount"].Orientation = PivotFieldOrientation.DataField;
IRange range = pivotTable.TableRange1;
string address = range.ToString();