Free Support Forum - aspose.com

Bug with Cell.PutValue(String stringValue- Boolean isConverted) when called as PutValue(""- true)

When this method was called with an empty string and isConverted set to true, via my call to ImportDataTable, the following exception occured:

System.IndexOutOfRangeException: Index was outside the bounds of the array. at Aspose.Cells.Cell.PutValue(String stringValue, Boolean isConverted) at Aspose.Cells.Cells.ImportDataTable(DataTable dataTable, Boolean isFieldNameShown, Int32 firstRow, Int32 firstColumn, Int32 rowNumber, Int32 columnNumber, Boolean insertRows, String numberFormatString, Boolean convertStringToNumber) at Aspose.Cells.Cells.ImportDataTable(DataTable dataTable, Boolean isFieldNameShown, Int32 firstRow, Byte firstColumn, Boolean insertRows, Boolean convertStringToNumber)

I found the bug does not occur if the method is called with an empty string and isConverted set to false.

I got around this exception by calling ImportDataTable with convertStringToNumber set to false instead of true, see such the conversion was not needed.

Thank you for this report.

Please try this attached fix. I fixed this issue.