You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by la...@videotron.ca on 2008/09/09 23:08:09 UTC

Modifying Chart Titles

Hi All,

Under 3.0.2 I was able to read and write excel files that had charts with long titles without problem.  POI 3.1 fails to read excel files that contain charts with titles longer than 256 characters.  With a little digging I found that in 3.1 chart titles are being read as SeriesTextRecords whereas in 3.0.2 they were being read as UnknownRecords.

SeriesTextRecords have a byte text length field that limits the title text length to 256 characters.  I presume that this is why 3.1 fails to read in files containing charts with long titles whereas the data length of the UnknownRecord is not limited and 3.0.2 had no problems.

Since excel allows for chart titles longer than 256 characters, I would presume the 256 character limit imposed by the SeriesTextRecord is a bug.  Is this the case?  Is there a work around for this problem?

Thanks in advance for your help.

Laird

Re: Modifying Chart Titles

Posted by "Laird A. Trimble" <la...@videotron.ca>.
Nick,

Thank you for your quick response.  I'll figure out how to use the  
bugzilla system and create a new bug (with file) tomorrow.

Laird


On 10-Sep-08, at 11:43 AM, Nick Burch wrote:

> On Tue, 9 Sep 2008, laird_trimble@videotron.ca wrote:
>> SeriesTextRecords have a byte text length field that limits the  
>> title text length to 256 characters.  I presume that this is why  
>> 3.1 fails to read in files containing charts with long titles  
>> whereas the data length of the UnknownRecord is not limited and  
>> 3.0.2 had no problems.
>
> POI 3.1 has a little bit more low level charting support.
>
> Page 398 points at page 850 of the excel spec, which clearly states  
> that the SeriesTextRecord is made up of a single byte length, some  
> flags, and then the text.
>
>> Since excel allows for chart titles longer than 256 characters, I  
>> would presume the 256 character limit imposed by the  
>> SeriesTextRecord is a bug.  Is this the case?  Is there a work  
>> around for this problem?
>
> Can you open a new bug in bugzilla, and upload a file that has a  
> longer title than 256 bytes? That way we can see what microsoft do  
> to get around their rather silly restriction of only using 1 byte  
> for the length
>
> Nick
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org


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


Re: Modifying Chart Titles

Posted by "Laird A. Trimble" <la...@videotron.ca>.
Nick,

After careful examination of the problem in preparation for submitting  
the bug report I have found out two things.  The first is that I  
cannot count.  The second is that my inability to count makes the  
problem even worse.

First of all, you are correct in that Excel limits titles to 256  
characters.  The problem is that POI 3.1 fails to read in excel files  
containing charts that have titles with more than 127 characters.  I  
have filed this as a bug report (#45784).    
RecordInputStream.readUnicodeLEString throws an  
IllegalArgumentException: Illegal length - asked for -16 but only 130  
left.  It looks like an issue of using a Java byte to describe and  
unsigned 8 bit number.

Laird


On 10-Sep-08, at 11:43 AM, Nick Burch wrote:

> On Tue, 9 Sep 2008, laird_trimble@videotron.ca wrote:
>> SeriesTextRecords have a byte text length field that limits the  
>> title text length to 256 characters.  I presume that this is why  
>> 3.1 fails to read in files containing charts with long titles  
>> whereas the data length of the UnknownRecord is not limited and  
>> 3.0.2 had no problems.
>
> POI 3.1 has a little bit more low level charting support.
>
> Page 398 points at page 850 of the excel spec, which clearly states  
> that the SeriesTextRecord is made up of a single byte length, some  
> flags, and then the text.
>
>> Since excel allows for chart titles longer than 256 characters, I  
>> would presume the 256 character limit imposed by the  
>> SeriesTextRecord is a bug.  Is this the case?  Is there a work  
>> around for this problem?
>
> Can you open a new bug in bugzilla, and upload a file that has a  
> longer title than 256 bytes? That way we can see what microsoft do  
> to get around their rather silly restriction of only using 1 byte  
> for the length
>
> Nick
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org


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


Re: Modifying Chart Titles

Posted by Nick Burch <ni...@torchbox.com>.
On Tue, 9 Sep 2008, laird_trimble@videotron.ca wrote:
> SeriesTextRecords have a byte text length field that limits the title 
> text length to 256 characters.  I presume that this is why 3.1 fails to 
> read in files containing charts with long titles whereas the data length 
> of the UnknownRecord is not limited and 3.0.2 had no problems.

POI 3.1 has a little bit more low level charting support.

Page 398 points at page 850 of the excel spec, which clearly states that 
the SeriesTextRecord is made up of a single byte length, some flags, and 
then the text.

> Since excel allows for chart titles longer than 256 characters, I would 
> presume the 256 character limit imposed by the SeriesTextRecord is a 
> bug.  Is this the case?  Is there a work around for this problem?

Can you open a new bug in bugzilla, and upload a file that has a longer 
title than 256 bytes? That way we can see what microsoft do to get around 
their rather silly restriction of only using 1 byte for the length

Nick