Hello,

In HSSFFormulaEvaluator::evaluateInCell the following case blocks
don't change cell type which lead to class cast exception.

case HSSFCell.CELL_TYPE_BOOLEAN:
  cell.setCellValue(cv.getBooleanValue());
  break;
case HSSFCell.CELL_TYPE_ERROR:
  cell.setCellValue(cv.getErrorValue());
  break;
case HSSFCell.CELL_TYPE_STRING:
  cell.setCellValue(cv.getRichTextStringValue());
  break;

Like cell.setCellValue(cv.getRichTextStringValue()) will check inside
if type is not string and not formula then change type. 

if ((cellType != CELL_TYPE_STRING ) && ( cellType !=
CELL_TYPE_FORMULA))
{
  setCellType(CELL_TYPE_STRING, false, row, col, styleIndex);
}

And if it's formula it will still invoke code like this: 
(( LabelSSTRecord ) record).setSSTIndex(index). 
LabelSSTRecord isn't there and this results in class cast exception.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to