if (book instanceof HSSFWorkbook) {
HSSFDataFormat df = ((HSSFWorkbook)book).createDataFormat();
final short fmt = df.getFormat(formatString);
style.setDataFormat(fmt);
} else {
XSSFDataFormat df = ((XSSFWorkbook)book).createDataFormat();
final short fmt = df.getFormat(formatString);
style.setDataFormat(fmt);
}
}