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 2008/08/22 18:34:30 UTC

DO NOT REPLY [Bug 45676] New: poi-3.5-beta1 XSSF event usermodel occasionally truncates cell values

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

           Summary: poi-3.5-beta1 XSSF event usermodel occasionally
                    truncates cell values
           Product: POI
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: POI Overall
        AssignedTo: dev@poi.apache.org
        ReportedBy: pdobson@viranim.com


When parsing large excel files using XSSF and the event usermodel, when the
needed data referred to by start and length variables refer to the end of ch[],
only part of the cell value is returned.  This will either give an incorrect
numeric value of a cell, or refer an incorrect position in the sharedStrings
file.
This can be verified by using the poi.xssf.eventusermodel.examples to parse a
very large sheet (several thousand rows with a couple dozen columns).  Put a
conditional breakpoint on the value of the variable start when start + length
is 2048 in the method "public void characters(char[] ch, int start, int length)
throws SAXException".  This will eventually give you a value that is truncated.
The value of ch needs to go to 2048 characters, then back up to the last
complete set of cell data rather than always cutting at exactly 2048 characters
and possibly truncating cell data being referred to.
This is a showstopper because the results of using the XSSF eventusermodel can
not be trusted when parsing large excel files.

Thanks.

Paul Dobson


-- 
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 45676] poi-3.5-beta1 XSSF event usermodel occasionally truncates cell values

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


Paul Dobson <pd...@viranim.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |ASSIGNED




--- Comment #4 from Paul Dobson <pd...@viranim.com>  2008-09-10 11:40:55 PST ---
I have attached a sample .xlsx file as well as a java program to test the
sample file.  The program will only work on the attached .xlsx file or one with
cell content laid out in a similar way.

Let me know if this is what you needed.

Paul


-- 
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 45676] poi-3.5-beta1 XSSF event usermodel occasionally truncates cell values

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





--- Comment #3 from Paul Dobson <pd...@viranim.com>  2008-09-10 11:36:48 PST ---
Created an attachment (id=22551)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22551)
Java program to test using SampleBigWorkbook.xlsx

This program is based on the sample code.  It outputs lines when it finds that
the cell value from the shared strings table does not match what it should be. 
It also outputs the value of the cell that was clipped to return the incorrect
string from the shared strings table.  

Let me know if you need anything else.

Thanks,

Paul


-- 
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 45676] poi-3.5-beta1 XSSF event usermodel occasionally truncates cell values

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





--- Comment #5 from Paul Dobson <pd...@viranim.com>  2008-09-11 15:01:27 PST ---
I did some more testing.  You are right.  It seems to be a problem in the
example code.  Consider the following change to endElement, and characters
methods.  I don't know if this is best way to fix the problem but it seems to
work in my case.

public void endElement(String uri, String localName, String name)
                        throws SAXException {
    // v => contents of a cell
    // Output after we've seen the string contents

    if(nextIsString) {
        idx = Integer.parseInt(lastContents);
        lastContents = sst.getSharedStringAt(idx);
    }
    if(name.equals("v")) {
    System.out.println(lastContents);
    }
     lastContents = "";
}

public void characters(char[] ch, int start, int length)
                                throws SAXException {
    lastContents += new String(ch, start, length);

}


-- 
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 45676] poi-3.5-beta1 XSSF event usermodel occasionally truncates cell values

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





--- Comment #2 from Paul Dobson <pd...@viranim.com>  2008-09-10 11:26:24 PST ---
Created an attachment (id=22550)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22550)
Large excel file for testing.

Use this file with the attached sample code to duplicate the problem. The file
has values in each cell corresponding the location of the cell.  The sample
code will only work with this file or a similarly formatted excel file.


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


Re: Attach Mp3/WAV to ppt slide

Posted by Yegor Kozlov <ye...@dinom.ru>.
http://poi.apache.org/hslf/how-to-shapes.html#Movies

Yegor

> All,
> 
>     I am ready with 500 slides and 500 MP3. Instead of manually attaching a
> audio to ppt slide, is there any POI API exists to manually attach 1.mp3 to
> slide 1 and so on?
> 
> Regards,
> Ramana Reddy


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


Attach Mp3/WAV to ppt slide

Posted by bvreddy <bv...@gmail.com>.
All,

    I am ready with 500 slides and 500 MP3. Instead of manually attaching a
audio to ppt slide, is there any POI API exists to manually attach 1.mp3 to
slide 1 and so on?

Regards,
Ramana Reddy
-- 
View this message in context: http://www.nabble.com/DO-NOT-REPLY--Bug-45676--New%3A-poi-3.5-beta1-XSSF-event-usermodel-occasionally-truncates-cell-values-tp19110934p19478638.html
Sent from the POI - Dev mailing list archive at Nabble.com.


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


DO NOT REPLY [Bug 45676] poi-3.5-beta1 XSSF event usermodel occasionally truncates cell values

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


Paul Dobson <pd...@viranim.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pdobson@viranim.com




-- 
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 45676] poi-3.5-beta1 XSSF event usermodel occasionally truncates cell values

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


Nick Burch <ni...@torchbox.com> changed:

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




--- Comment #1 from Nick Burch <ni...@torchbox.com>  2008-09-07 13:04:59 PST ---
Any chance you could upload a suitably large file that triggers this bug?

I have a feeling it's actually a bug in the example, rather than in xssf
itself, but I'll need a sample file to test this hunch


-- 
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 45676] poi-3.5-beta1 XSSF event usermodel occasionally truncates cell values

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


Nick Burch <ni...@torchbox.com> changed:

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




--- Comment #6 from Nick Burch <ni...@torchbox.com>  2008-09-13 07:01:26 PST ---
Yup, your fix looks like it's the right one, thanks for figuring that out.

I've fixed the documentation and example in svn, so they'll be included in the
next beta


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