Hi,
After upgrading Aspose.Cells to its latest version 21.6.0, I noticed Cells.ImportTwoDimensionArray no longer works properly and produces incorrect data on random cells.
Code:
var arrayOutCopy = new object[210, 15]; var lines = System.IO.File.ReadAllLines(@".\data.out"); for (int row = 0; row < lines.Length; ++row) { var fields = lines[row].Split(';'); for (int col = 0; col < 15; col++) { arrayOutCopy[row, col] = fields.Length > col && !string.IsNullOrEmpty(fields[col]) ? fields[col] : null; } } var workbook = new Workbook(@".\model.xlsx"); var outputWorkbook = new Workbook(); outputWorkbook.Copy(workbook); Cells cellsToAddTo = outputWorkbook.Worksheets[0].Cells; var txtLoadOptions = new TxtLoadOptions { ConvertDateTimeData = true, ConvertNumericData = true, LoadStyleStrategy = TxtLoadStyleStrategy.BuiltIn }; cellsToAddTo.ImportTwoDimensionArray(arrayOutCopy, null, 0, 0, txtLoadOptions); outputWorkbook.Save(@".\out.xlsx");
The code above reads data from file ‘test.out’ into a 2D Array, then import it to a model file.
With previous Aspose versions (e.g. 21.2.0), all data was imported correctly, but with 21.6.0, wrong data appeared on some cells.
I’ve attached the test files and screenshots before/after upgrade here for your reference:
data.zip (104.5 KB)
21.2.0 (working): image.png (70.0 KB)
21.6.0 (not working): image.png (92.6 KB)
As we are heavily relying on Aspose’s functionality to import data, this prevents us from using the latest version. Could you help me check this regression?
Thanks,