Problem in getting contents of formula based cell using JXL api in JAVA

Posted by user202328 on Stack Overflow See other posts from Stack Overflow or by user202328
Published on 2009-11-04T04:55:17Z Indexed on 2010/03/13 11:35 UTC
Read the original article Hit count: 366

Filed under:

Hello,

I am facing a problem while getting contents of cell using JXL api, if I am using formula in xls sheet. Right now I am using formula - IF($L10="","",+ROUND($L10*1.375,3)) in each cell but when the cell value is blank i am getting junk charactes when i call cell.getContents() method, the code snip is as follows - >>

Workbook = Workbook.getWorkbook(p_sourceFile);

excelsheet = workbook.getSheet(0);
for (int row = 1; row < noOfRows; row++)

{ cell = excelsheet.getCell(col, row); content = cell.getContents();

System.out.println("content-" + content); //Is giving me junk character ? when the cell value is blank.

...

It will be a great help if anyone can help me !!!

Regards, Amit

© Stack Overflow or respective owner

Related posts about jxl