poi ¶óÀ̺귯¸®·Î Excel File Spread Sheet Cell Àбâ
½Ä(formula)À¸·Î µÈ ¿¢¼¿ ÆÄÀÏ ¾ÈÀÇ cell °ªÀ» Àд ¹æ¹ý
±×³É cell.getStringCellValue() ÀÌ·± ½ÄÀ¸·Î È£ÃâÇϸé Cannot get a text value from a numeric formula cell ¿¡·¯°¡ ³´Ù.
cellValue = cell.getCellFormula();
ÀÌ·¸°Ô Çϸé "F2/D2" ÀÌ·± formula ¹®ÀÚ¿À» ¾ò´Â´Ù.
½Ä(formula)¸¦ °è»êÇÑ °ªÀ» ¾ò±â À§Çؼ´Â ´ÙÀ½°ú °°ÀÌ ÇØ¾ß ÇÑ´Ù.
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellValue;
import org.apache.poi.ss.usermodel.FormulaEvaluator;
import org.apache.poi.ss.usermodel.Workbook;
FormulaEvaluator formulaEval = workbook.getCreationHelper().createFormulaEvaluator();
String cellValue = "";
if( cell != null ) {
CellValue evaluate = formulaEval.evaluate(cell);
if( evaluate != null )
cellValue = evaluate.formatAsString();
}
[Ãâó] http://stackoverflow.com/questions/4183708/how-to-get-the-formula-cell-valuedata-using-apache-poi
Ãâó: http://bryan7.tistory.com/460 [¹Î¼³×Áý]