You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2009/02/03 04:35:10 UTC

DO NOT REPLY [Bug 46654] New: "Unable to read file" after "shiftRows"

https://issues.apache.org/bugzilla/show_bug.cgi?id=46654

           Summary: "Unable to read file" after "shiftRows"
           Product: POI
           Version: 3.5-dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: matthew.knl@gmail.com


Created an attachment (id=23215)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23215)
Testing file

I use following codes to open an Excel file, then call "sheet.shiftRows", but
the output file cannot be opened by MS Excel. It prompted "Unable to read
file." error message.
--
HSSFWorkbook wb = new HSSFWorkbook(ExcelUtil.fixInputStream(new
FileInputStream("unable_to_read_file.xls")));
HSSFSheet sheet = wb.getSheet("Other");
sheet.shiftRows(12, 165, 12, false, true);
wb.write(new FileOutputStream("unable_to_read_file.output.xls"));
--
Please use the attached file for testing, thanks a lot!


-- 
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


DO NOT REPLY [Bug 46654] "Unable to read file" after "shiftRows"

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46654


Josh Micich <jo...@gildedtree.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #1 from Josh Micich <jo...@gildedtree.com>  2009-02-04 23:53:14 PST ---
Fixed in svn r741036 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=741036 )(and svn r741037 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=741037 ))

The example spreadsheet you supplied has incorrect values in RowRecord firstCol
& lastCol.  Excel has no problem with those values being wrong, except when no
cells are present.  POI wasn't properly updating these indexes the newly
emptied row.  This problem has been fixed and a junit has been added.

Some extra confusion was noticed regarding cell comments (HSSFComment).  It
seems like the firstCol and lastCol fields of RowRecord need to take cell
comments into account.  POI does not do this yet.  Some significant
restructuring might be required to make that work properly.


-- 
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