poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46535] New: Cell type cannot be changed and the output file cannot be opened by MS Excel 2007
Date Thu, 15 Jan 2009 06:41:30 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=46535

           Summary: Cell type cannot be changed and the output file cannot
                    be opened by MS Excel 2007
           Product: POI
           Version: 3.5-dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: XSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: matthew.knl@gmail.com


I use following codes which assign a string value into a cell.

That cell is a formula cell originally, I found that after the value is
assigned, the cell type is still remain "Formula Type".

AND when I open the output excel file, it cannot be opened by MS Excel 2007.
(In fact, it can be opened but which need to be recovered by MS Excel 2007.)

--

Workbook wb = new XSSFWorkbook("original.xlsm");
String value = "ABC";
Sheet sheet = wb.getSheet("Test");
Row row = sheet.getRow(0);
Cell cell = row.getCell(4);
System.out.println("before cell.getCellType() :" + cell.getCellType());
cell.setCellType(Cell.CELL_TYPE_STRING);
cell.setCellValue(value);
cell.setCellType(Cell.CELL_TYPE_STRING);
System.out.println("after cell.getCellType() :" + cell.getCellType());
FileOutputStream output = new FileOutputStream("output.xlsm");
wb.write(output);

--

Thanks!


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message