Summary: | can't read existing formula cells | ||
---|---|---|---|
Product: | POI | Reporter: | Ethan Shayne <ethanshayne> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 2.0-pre3 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | An example of a formula-based cell that I cannot read/access - cell A1 |
Description
Ethan Shayne
2003-06-06 15:20:05 UTC
When there are merged cells involved, the getCell target may be a little off. Please provide sample code/excel files so we can take a look at it. Created attachment 6678 [details]
An example of a formula-based cell that I cannot read/access - cell A1
This is the code I am using to access the attached spreadsheet: FileInputStream inputFile = new FileInputStream("c:\\temp\\test.xls"); POIFSFileSystem fileSystem = new POIFSFileSystem(inputFile); HSSFWorkbook workbook = new HSSFWorkbook(fileSystem); HSSFSheet spreadsheet = workbook.getSheetAt(0); HSSFRow row = spreadsheet.getRow(0); HSSFCell cell = row.getCell((short)0); "cell" is coming out null. this should work. We should fix this. I can't reproduce this with a recent stock CVS checkout. I have a quickie formula test program that reads the attached .xls file fine and produces this: Formula: <B1+C1> Raw formula = <B1 C1 + > Printing cell references: (Ref) B1 (Ref) C1 (the formula is in cell (0,0) on sheet 0. This works, no problems at all. |