[]
This class extends JsonError and stores the worksheet name, row index, column index, and formula text associated with a formula that could not be processed. It is typically used to describe formula errors reported while loading workbook data from JSON.
Workbook sourceWorkbook = new Workbook();
sourceWorkbook.getWorksheets().get(0).getRange("C2").setFormula("=SUM(A1:A2)");
String json = sourceWorkbook.toJson().replace("SUM(A1:A2)", "SUM(A1:)");
Workbook importedWorkbook = new Workbook();
List<JsonError> errors = importedWorkbook.fromJson(json);
FormulaJsonError error = (FormulaJsonError) errors.get(0);
String worksheetName = error.getWorksheetName();
String formula = error.getFormula();
FormulaJsonError(String errorMessage,
String worksheetName,
int row,
int column,
String formula) intintgetRow()getErrorMessageerrorMessage - The error message associated with the formula error.worksheetName - The name of the worksheet where the formula error occurred.row - The row index where the formula error occurred.column - The column index where the formula error occurred.formula - The formula that caused the error.This value identifies the worksheet associated with the invalid or unprocessed formula in the imported JSON content.
Workbook sourceWorkbook = new Workbook();
sourceWorkbook.getWorksheets().get(0).getRange("C2").setFormula("=SUM(A1:A2)");
String json = sourceWorkbook.toJson().replace("SUM(A1:A2)", "SUM(A1:)");
Workbook importedWorkbook = new Workbook();
List<JsonError> errors = importedWorkbook.fromJson(json);
FormulaJsonError error = (FormulaJsonError) errors.get(0);
String worksheetName = error.getWorksheetName();
null if no worksheet name was provided.This value identifies the row associated with the invalid or unprocessed formula in the imported JSON content.
Workbook sourceWorkbook = new Workbook();
sourceWorkbook.getWorksheets().get(0).getRange("C2").setFormula("=SUM(A1:A2)");
String json = sourceWorkbook.toJson().replace("SUM(A1:A2)", "SUM(A1:)");
Workbook importedWorkbook = new Workbook();
List<JsonError> errors = importedWorkbook.fromJson(json);
FormulaJsonError error = (FormulaJsonError) errors.get(0);
int row = error.getRow();
This value identifies the column associated with the invalid or unprocessed formula in the imported JSON content.
Workbook sourceWorkbook = new Workbook();
sourceWorkbook.getWorksheets().get(0).getRange("C2").setFormula("=SUM(A1:A2)");
String json = sourceWorkbook.toJson().replace("SUM(A1:A2)", "SUM(A1:)");
Workbook importedWorkbook = new Workbook();
List<JsonError> errors = importedWorkbook.fromJson(json);
FormulaJsonError error = (FormulaJsonError) errors.get(0);
int column = error.getColumn();
This method returns the formula string that could not be processed when the workbook data was loaded from JSON.
Workbook sourceWorkbook = new Workbook();
sourceWorkbook.getWorksheets().get(0).getRange("C2").setFormula("=SUM(A1:A2)");
String json = sourceWorkbook.toJson().replace("SUM(A1:A2)", "SUM(A1:)");
Workbook importedWorkbook = new Workbook();
List<JsonError> errors = importedWorkbook.fromJson(json);
FormulaJsonError error = (FormulaJsonError) errors.get(0);
String formula = error.getFormula();
null if no formula was provided.