[]
Gets or sets the string displayed in cells that contain errors when DisplayErrorString is true.
The default value is an empty string (""). Use ErrorString
to specify the custom error text shown by the PivotTable for error cells.
string ErrorString { get; set; }
Property ErrorString As String
worksheet.Range["A1:B4"].Value = new object[,] {
{"Category", "Amount"},
{"A", 10},
{"B", 20},
{"A", 15}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "PivotTable1");
pivotTable.DisplayErrorString = true;
pivotTable.ErrorString = "Invalid";
string errorString = pivotTable.ErrorString;