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 2011/06/22 14:24:02 UTC

DO NOT REPLY [Bug 51416] New: getFirstRowNum() org.apache.poi.ss.usermodel.Sheet returns -1 next is 1

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

             Bug #: 51416
           Summary: getFirstRowNum() org.apache.poi.ss.usermodel.Sheet
                    returns -1 next is 1
           Product: POI
           Version: 3.7
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: XSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: jordan@ffm-one.com
    Classification: Unclassified


Hi,

I have written a program that reads xlsx files.

Regarding your example HSSFReadWrite.java 

...
int rows = sheet.getPhysicalNumberOfRows();
...
for (int r = 0; r < rows; r++)

rows start with 0.

So I also start iterating rows from 0 on. But now I have a xlsx where the rows
do not start with 0 but with -1 (result of getFirstRowNum() is -1).
getRow(0) is null and getRow(1) is working as usual.

"-1 => <xml-fragment r="0" spans=""
xmlns:main="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
"1 => <xml-fragment r="2" spans="1:36"
xmlns:main="http://schemas.openxmlformats.org/spreadsheetml/2006/main">

I tried this on Windows Vista and Windows Server 2008.

Regards
Volker Jordan

-- 
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 51416] getFirstRowNum() org.apache.poi.ss.usermodel.Sheet returns -1 next is 1

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

Yegor Kozlov <ye...@dinom.ru> changed:

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

-- 
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 51416] getFirstRowNum() org.apache.poi.ss.usermodel.Sheet returns -1 next is 1

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

Volker Jordan <jo...@ffm-one.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

-- 
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 51416] getFirstRowNum() org.apache.poi.ss.usermodel.Sheet returns -1 next is 1

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

--- Comment #2 from Volker Jordan <jo...@ffm-one.com> 2011-06-28 14:34:35 UTC ---
Hi Yegor,

I tested the file with POI 3.8-beta3 with the same result.

As the file contains confidential data, I can not attach it to this bug, but
there is something I noticed.

When I go into the raw xml structure, I see:

<row r="0" spans="">
<row r="2" spans="1:36">

When I open the file again in Excel and save it, it shows:

<row r="1" spans="1:36" ht="51">
<row r="2" spans="1:36">

I think this is the root cause, but why has this happen ? And is this something
POI should consider that this can happen?

Regards
Volker

-- 
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 51416] getFirstRowNum() org.apache.poi.ss.usermodel.Sheet returns -1 next is 1

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

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2011-06-24 08:55:37 UTC ---
Please try the latest release POI 3.8-beta3. 

If the problem is still there, please attach a sample code to demonstrate the
problem. If it requires an input .xlsx file the attach that file too.

Yegor

-- 
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 51416] getFirstRowNum() org.apache.poi.ss.usermodel.Sheet returns -1 next is 1

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

--- Comment #3 from Yegor Kozlov <ye...@dinom.ru> 2011-06-30 16:19:07 UTC ---
r="0" is invalid, Office requires that the r attribute be between 1 and 1048576
inclusive. 

What software produced this file? Unzip it and look in docProps/app.xml.

Yegor

(In reply to comment #2)
> Hi Yegor,
> 
> I tested the file with POI 3.8-beta3 with the same result.
> 
> As the file contains confidential data, I can not attach it to this bug, but
> there is something I noticed.
> 
> When I go into the raw xml structure, I see:
> 
> <row r="0" spans="">
> <row r="2" spans="1:36">
> 
> When I open the file again in Excel and save it, it shows:
> 
> <row r="1" spans="1:36" ht="51">
> <row r="2" spans="1:36">
> 
> I think this is the root cause, but why has this happen ? And is this something
> POI should consider that this can happen?
> 
> Regards
> Volker

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