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 2014/05/30 06:09:56 UTC

[Bug 56579] New: Cell Value - String 32,767 Character Limit

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

            Bug ID: 56579
           Summary: Cell Value - String 32,767 Character Limit
           Product: POI
           Version: 3.10
          Hardware: Macintosh
            Status: NEW
          Severity: minor
          Priority: P2
         Component: SXSSF
          Assignee: dev@poi.apache.org
          Reporter: mhager@w2odigital.com

There is a 32,767 max character limit for strings in Excel. If one writes an
XML file that exceeds this limit, the file is subject to inspection and
correction by Excel on the first load (which is really annoying). 

Microsoft Documentation On Limit
http://office.microsoft.com/en-us/excel-help/excel-specifications-and-limits-HP010342495.aspx?CTT=5&origin=HP005199291

Workaround (Caller - Example)
cell.setCellValue(toWrite.length() > 32767 ? toWrite.substring(0, 32767 - 3) +
"..." : toWrite);

Proposed Solution
Simply truncate the string the same way Excel would truncate the string upon
first inspection and load and provide sufficient documentation alerting users
of the what a cell value can hold.

or...

Either throw a RuntimeException alerting the user of the impending error

I'll open for discussion if you would like a pull request, please, just let me
know and I'd be happy to put one together, with a test for the team.

Thank You!

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


[Bug 56579] Cell Value - String 32,767 Character Limit

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

--- Comment #4 from Mirjan Merruko <mm...@gmail.com> ---
Hi,

I've run into the same problem while working with apache POI 3.9-20121203. One
thing that I'd like to note here is that apache poi doesn't have any problems
reading back the content of the cell and the conent is exactly what is stored
before.

The file though is unusable by Microsoft Excel and what I've observed is that
once we decide to let Excel recover the contents then the cell contents are
truncated.

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


[Bug 56579] Cell Value - String 32,767 Character Limit

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

--- Comment #3 from Nick Burch <ap...@gagravarr.org> ---
If you spot any issues with the docs, or areas where extra examples would be
helpful, whilst doing your Streams work we'd be delighted to have updates :)

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


[Bug 56579] Cell Value - String 32,767 Character Limit

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

--- Comment #2 from smashew <mh...@w2odigital.com> ---
Nick,

Thank you very much for the reply. I will create a patch this weekend after I
get done with my work. :o)

Great work team, doing a lot of work over at Apache Streams (Incubating) and
this will make a great addition.

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


[Bug 56579] Cell Value - String 32,767 Character Limit

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

Nick Burch <ap...@gagravarr.org> changed:

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

--- Comment #1 from Nick Burch <ap...@gagravarr.org> ---
In HSSFCell, we have the following logic:

throw new IllegalArgumentException("The maximum length of cell contents (text)
is 32,767 characters");

I'd suggest we just apply the same in XSSF too, if you could do a patch and a
unit test that'd be great!

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