We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Empty cell data

How can we figure out the empty cell?

We are using the com.aspose.cells.CellHandler events class.

Thanks
-AG-

Hi,

Well, you may use LightCell.getValueType(), Cell.getValue() Cell.getValueType() methods to evaluate CellValueType.

Thank you.

We are processing the cell using the process method which is not called when cell is empty so not able to use cell.getValueType() methods .

Is there any other event/method in the CellHandler which can be overridden to check the blank/null value in the cell?


Here is part of code:

case CellValueType.DOUBLE:

d = ((Double)cell.getValue()).doubleValue();
DecimalFormat df = new DecimalFormat("##");
addCellValueToFile(df.format(d),row);
break;

case CellValueType.INT:

int intValue = ((Integer)cell.getValue()).intValue();
addCellValueToFile(new Integer(intValue).toString(),row);
break;

case CellValueType.STRING:
String strText= (String)cell.getValue();
addCellValueToFile(strText,row);
break;

}
}

Please let me know if you required any other info. from my side.

Thanks
-AG-

Hi,

Currently we ignore the empty cells when iterate cells one by one in Event-driven mode. For normal Excel file, cells are processed in ascending order of row by row and column by column, so, I think you can reserve the previous cell has been processed, and compare it's row and column to the next cell, if the row or column is not continuous, the cells between them are empty.