public enum IgnoredErrorTypes extends Enum<IgnoredErrorTypes>
A cell is considered to have an error condition when it meets one of the conditions specified in the IgnoredError.getErrorTypes()
member.
For example, if a cell is formatted as text but contains a numeric value, this is considered to be a potential error because the number won't be treated as a number, for example, in calculations.
Note that this is simply a guess by the implementing application, and a recommendation to the user.
Cells with the errors specified in IgnoredErrorTypes
may have perfectly valid reasons for being in such a state, for example a cell formatted as text which contains numeric Postal Codes or Order numbers.
It is useful to format these cells as text so that leading zeros remain as part of the value instead of being removed.
Following example shows that cells A1 and B1 both contain numbers stored as text, and this error has been reviewed and specifically flagged to be no longer surfaced as an error to the user.
ExcelFile workbook = new ExcelFile();
ExcelWorksheet worksheet = workbook.addWorksheet("Sheet1");
worksheet.getCell("A1").setValue("00385");
worksheet.getCell("B1").setValue("00387");
worksheet.getIgnoredErrors().add("A1 B1", EnumSet.of(IgnoredErrorTypes.NUMBER_STORED_AS_TEXT));
Enum Constant and Description |
---|
CALCULATED_COLUMN
Ignore errors when cells contain a value different from a calculated column formula for tables.
|
EMPTY_CELL_REFERENCE
Ignore errors when formulas refer to empty cells.
|
EVALUATION_ERROR
Ignore errors when cells contain formulas that result in an error such as '#VALUE!' or '#DIV/0!'.
|
FORMULA
Ignore errors when a formula in a region of your worksheet differs from other formulas in the same region.
|
FORMULA_RANGE
Ignore errors when formulas omit certain cells in a region.
|
LIST_DATA_VALIDATION
Ignore errors when a cell's value in a Table does not comply with the Data Validation rules specified.
|
NUMBER_STORED_AS_TEXT
Ignore errors when numbers are formatted as text or are preceded by an apostrophe.
|
TWO_DIGIT_TEXT_YEAR
Ignore errors when cells contain dates in text form with years represented as 2 digits.
|
UNLOCKED_FORMULA
Ignore errors when unlocked (editable) cells in the locked sheet contain formulas.
|
Modifier and Type | Method and Description |
---|---|
static EnumSet<IgnoredErrorTypes> |
all()
Ignore all errors.
|
static IgnoredErrorTypes |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static IgnoredErrorTypes[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final IgnoredErrorTypes CALCULATED_COLUMN
Ignore errors when cells contain a value different from a calculated column formula for tables.
In other words, for a calculated column, a cell in that column is considered to have an error if its formula is different from the calculated column formula, or doesn't contain a formula at all.
public static final IgnoredErrorTypes EMPTY_CELL_REFERENCE
public static final IgnoredErrorTypes EVALUATION_ERROR
public static final IgnoredErrorTypes FORMULA
Ignore errors when a formula in a region of your worksheet differs from other formulas in the same region.
For example, if the formula in cell A1 is "=B1", and the formula in cell A3 is "=B3", but the formula in cell A2 is not "=B2" but instead "=C2", then A1 and A3 both refer to the cell one column to their right, but A2 does not and so is inconsistent with them.
public static final IgnoredErrorTypes FORMULA_RANGE
Ignore errors when formulas omit certain cells in a region.
For example, if there is data in cells A1:A100 and formula contains the reference "=SUM(A1:A98)".
public static final IgnoredErrorTypes LIST_DATA_VALIDATION
Ignore errors when a cell's value in a Table does not comply with the Data Validation rules specified.
For example, when a cell's value is inconsistent with the column data type for Tables connected to SharePoint data.
public static final IgnoredErrorTypes NUMBER_STORED_AS_TEXT
public static final IgnoredErrorTypes TWO_DIGIT_TEXT_YEAR
public static final IgnoredErrorTypes UNLOCKED_FORMULA
public static EnumSet<IgnoredErrorTypes> all()
public static IgnoredErrorTypes valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static IgnoredErrorTypes[] values()
for (IgnoredErrorTypes c : IgnoredErrorTypes.values()) System.out.println(c);
© GemBox Ltd. — All rights reserved.