Bug 46699 - Unable to modify cell contents in a spreadsheet
Summary: Unable to modify cell contents in a spreadsheet
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.2-FINAL
Hardware: PC Windows XP
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-11 13:23 UTC by Deepak Premnath
Modified: 2010-02-26 18:21 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Deepak Premnath 2009-02-11 13:23:29 UTC
This is just an enhancement request to make modifications to cell values in an excel spreadsheet relatively easier.
Comment 1 Nick Burch 2009-02-11 15:18:38 UTC
Editing contents of an excel spreadsheet is already fully supported by the hssf usermodel
Comment 2 krishna81m@gmail.com 2010-02-26 15:27:27 UTC
Isn't the following code kind of an over kill to update a single cell in a huge workbook with many sheets?

InputStream inp = new FileInputStream("wb.xls");
    Workbook wb = WorkbookFactory.create(inp);
    Sheet sheet = wb.getSheetAt([sheet index]);
    Row row = sheet.getRow([row index]);
    Cell cell = row.getCell([cell index]);
    String cellContents = cell.getStringCellValue(); 
    //Modify the cellContents here
    // Write the output to a file
    cell.setCellValue(cellContents); 
    FileOutputStream fileOut = new FileOutputStream("wb.xls");
    wb.write(fileOut);
    fileOut.close();
Comment 3 Nick Burch 2010-02-26 15:42:03 UTC
Please ask questions on the list, rather than hijacking old bugs
Comment 4 krishna81m@gmail.com 2010-02-26 18:21:13 UTC
(In reply to comment #3)
> Please ask questions on the list, rather than hijacking old bugs

Hijack old bug? ;) I preferred to use an already requested enhancement (rather than a bug) as asking for an enhancement on a list wouldn't help!

Sure, the title of the enhancement does not make sense to my context, in which case, you could have suggested me to raise a new enhancement or is my question incorrect, that I should ask for a solution on the list?