I tried to find a solution already, but nothing worked, which corresponds to my problem. I use JXL to read an Excel spreadsheet and convert each row to the specified object. Each cell inside the row corresponds to the property of the object that I create. My table has 41 columns and after reading 375 rows the number of cells in a row changes from 41 to 32. I canβt understand why.
Here is the code where I iterate over the rows and retrieve the cells:
w = Workbook.getWorkbook(inputWorkbook);
Sheet sheet = w.getSheet(0);
for (int row=1; row < sheet.getRows();row++)
{
EventData event = new EventData();
try
{
Cell[] cell = sheet.getRow(row);
event.Name = cell[0].getContents();
event.Location = cell[1].getContents();
The rest of the code continues to capture the contents of each cell and assigns them accordingly. But when you try to access cell [32] on line 376, I get an exception outside.
source
share