[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotTable.HasAutoFormat

HasAutoFormat Property

HasAutoFormat

Gets or sets a value indicating whether the PivotTable report automatically fits column widths when it is refreshed.

The default value is true.

Declaration
bool HasAutoFormat { get; set; }
Property HasAutoFormat As Boolean
Examples
worksheet.Range["A1:B4"].Value = new object[,] {
    {"Product", "Amount"},
    {"Apple", 100},
    {"Orange", 200},
    {"Apple", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "SalesPivot");
bool hasAutoFormat = pivotTable.HasAutoFormat;