[]
Gets the range that contains the entire PivotTable report, including page fields.
Use this property to retrieve the full displayed PivotTable area, including filter areas, rather than only the main report body.
IRange TableRange2 { get; }
ReadOnly Property TableRange2 As IRange
worksheet.Range["A1:B4"].Value = new object[,] {
{"Category", "Amount"},
{"Beverages", 120},
{"Beverages", 80},
{"Snacks", 50}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D2"], "SalesPivot");
pivotTable.PivotFields["Category"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Amount"].Orientation = PivotFieldOrientation.DataField;
IRange range = pivotTable.TableRange2;