I am using the following code and its returning empty string.
- Code: Select all
spread = SpreadsheetMLPackage.load(new File(mainFile));
WorksheetPart sheetpart = (WorksheetPart) spread.getParts().get(new PartName("/xl/worksheets/sheet1.xml"));
List<Row> rows = sheetpart.getContents().getSheetData().getRow();
r = rows.get(i);
for (Cell cr : r.getC())
{
if (cr.getF() != null)
{
System.out.println(cr.getF().getValue());
}
}
Its is returning empty string.
When I write the whole pakage using
- Code: Select all
spread.save(new File(output));
All the formulas are retained.
Is this not the correct place to look for formula strings? Please help.