[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotTable.TableRange2

TableRange2 Property

TableRange2

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.

Declaration
IRange TableRange2 { get; }
ReadOnly Property TableRange2 As IRange
Examples
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;