[]
Gets or sets whether the last column style is displayed in the PivotTable.
This property indicates whether the PivotTable style is applied to the last column of the PivotTable report.
bool ShowTableStyleLastColumn { get; set; }
Property ShowTableStyleLastColumn As Boolean
worksheet.Range["A1:B4"].Value = new object[,] {
{"Category", "Amount"},
{"Fruit", 100},
{"Drink", 200},
{"Fruit", 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;
pivotTable.ShowTableStyleLastColumn = true;
bool showLastColumnStyle = pivotTable.ShowTableStyleLastColumn;