java.lang.ArrayIndexOutOfBoundsException/setFormula1

Hi,

Im using Aspose Cells 7.1.0.3, and when i want to save a workbook i get the following Exception : from com.aspose.cells.Workbook.a : java.lang.ArrayIndexOutOfBoundsException

I know that it comes from setFormula1 because the string which is passed on parameter is too long,So i want to know the max length of "setFormula1" , please.

Thanks for help.

Hi,


Thank you for using Aspose.Cells for Java. Please download and use this latest fix: Aspose.Cells for Java v7.2.1.8 and see if solves your problem.

If the problem still persists, please share with us your sample source Excel file or Java code that we can use to replicate the issue for further investigation.

Thanks for your interest,

The problem is always here, even if i use the fix :

This is a part of the code :

ValidationCollection validations = worksheet.getValidations();

int index = validations.add();

Validation validation = validations.get(index);

// Set the validation type. validation.setType(ValidationType.LIST);

// Set the in cell drop down.

validation.setIgnoreBlank(true);

validation.setInCellDropDown(true);

validation.setShowError(true);

validation.setErrorTitle("Error");

validation.setErrorMessage("You must select one of the value available in the drop-down list box");

validation.setShowInput(true);

validation.setInputMessage("");

// Specify the validation area of cells.

CellArea area = new CellArea(); area.StartRow = 2;

area.EndRow = 500;

area.StartColumn = i;

area.EndColumn = i;

// Set the formula1.

validation.setFormula1(strValidation);

// Add the Validation area.

validation.addArea(area);

NB : strValidation is a concatenation of string separated by ";" like this one : 1- Support operations will halt if application goes down;2- Support operations will halt if application goes down, but there is no manual workaround;4- Critical business operations will halt if application goes down;3- Critical business operations will halt if application goes down, but there is an acceptable manual1- Support operations will halt if application goes down;2- Support operations will halt if application goes down, but there is no manual workaround;4- Critical business operations will halt if application goes down;3- Critical business operations will halt if application goes down, but there is an acceptable manual.

Hi,


After further investigation into the issue, I was able to reproduce the issue at my end with the latest fix of Aspose.Cells for Java. It seems that when the string length increases than 255, the error is generated. Even if I consider only one string (instead of multiple separated by “;”), I still get the issue.

I am forwarding this issue to our development team to look into it further. We will let you know once we get an update from our development team.


The issue has been logged as id: CELLSJAVA-40212.

Hi,

We have looked into this issue and found, it is not the issue of Aspose.Cells but Ms-Excel restriction.

The Max Length allowed by Ms Excel is 255. User cannot input string value
longer than 255 even in Ms-Excel manually. So we cannot support such a long string value.