[prev in list] [next in list] [prev in thread] [next in thread] 

List:       poi-user
Subject:    Re: HSSF SeriesTextRecord not included in RecordFactory?
From:       "Andrew C. Oliver" <acoliver () apache ! org>
Date:       2006-03-11 22:29:56
Message-ID: 44134F64.1010000 () apache ! org
[Download RAW message or body]

wait just re-read this..  What is special about this sheet that 
readwrite files?  Just that it has the seriestextrecord?

Andrew C. Oliver wrote:
> That's probably why its not included then.
> 
> jwang@dicarta.com wrote:
> 
>> Sorry about the silence, I didn't get a chance to run the tests until
>> now.
>>
>> 1) The unit tests all run, with the exception of 10, and looking at
>> those, they don't seem to have anything to do with record factory.
>> (Removing SeriesTextRecord.class and re-running gives the same 10
>> failures.)
>> 2) HSSF readwrite test fails with or without the class included.  The
>> file is generated, but when opening with Excel, I get a dialog of "data
>> may have been lost" and some of the displays are indeed "#NAME?"s
>>
>> a cursory glance at the printlns for the stRecord.getText() seems to
>> indicate that it is correct though.  So reading seems to be fine.
>>
>> Jeff Wang
>> diCarta, Inc.
>>
>> -----Original Message-----
>> From: Andrew C. Oliver [mailto:acoliver@apache.org] Sent: Wednesday, 
>> March 08, 2006 4:28 PM
>> To: poi-user@jakarta.apache.org
>> Subject: Re: HSSF SeriesTextRecord not included in RecordFactory?
>>
>> I do not know of a specific reason it is not there.  When you add it 
>> do the unit tests pass?  Moreover if you do the rewrite test on a 
>> sheet with one in it:
>>
>> org.apache.poi.hssf.dev.HSSF input.xls output.xls
>>
>> is the result okay?   If not...that is the reason.   If so...I can think
>>
>> of no reason.
>>
>> jwang@dicarta.com wrote:
>>
>>  
>>
>>> Sorry, bad copy and paste, I was trying to remove extraneous code in
>>> between the cast and the getText()...
>>>
>>> What I originally had was:
>>>
>>> SeriestTextRecord stRecord = (SeriesTextRecord) record;
>>>
>>> ....
>>>
>>> stRecord.getText();
>>>
>>>
>>> In any case, the passed in record is of type UnknownRecord as opposed
>>>   
>>
>> to
>>  
>>
>>> the expected SeriesTextRecord.  Switching on record.getSid() gets us to
>>> the case statement.  I have added in SeriesTextRecord.class in line 46
>>> of org.apache.poi.hssf.record.RecordFactory, and everything works fine
>>>   
>>
>> -
>>  
>>
>>> the passed in record is of the expected type.  I'm just wondering
>>> whether the fact that it's not in RecordFactory is just a
>>> oversight(bug?) or was there a deliberate reason for removing it.
>>>
>>> Thanks for the help.
>>> Jeff Wang
>>> diCarta, Inc.
>>>
>>> -----Original Message-----
>>> From: Andrew C. Oliver [mailto:acoliver@apache.org] Sent: Wednesday, 
>>> March 08, 2006 2:30 PM
>>> To: POI Users List
>>> Subject: Re: HSSF SeriesTextRecord not included in RecordFactory?
>>>
>>> jwang@dicarta.com wrote:
>>>
>>>
>>>   
>>>
>>>> I am getting a class cast exception on the following in my listener:
>>>>
>>>>               case SeriesTextRecord.sid:
>>>>                   String text = (SeriesTextRecord) record.getText();
>>>>  
>>>>     
>>>
>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>
>>>    case SeriesTextRecord.sid:
>>>       String text = ((SeriesTextRecord)record).getText();
>>>
>>>
>>>
>>>
>>>   
>>>
>>>> When I prepend the case statement with the following:
>>>>           if (record instanceof UnknownRecord) {
>>>>               UnknownRecord ur = (UnknownRecord) record;
>>>>               System.out.println("Excel extractor can't handle
>>>>  
>>>>     
>>>
>>> record
>>>
>>>
>>>   
>>>
>>>> type "+ur.getSid());
>>>>               return;
>>>>           }
>>>>
>>>> I get a lot of:
>>>> Excel extractor can't handle record type 4109
>>>>
>>>> Which is the sid for SeriesTextRecord.  Looking at
>>>> org.apache.poi.hssf.record.RecordFactory, SeriesTextRecord.class is
>>>> included in neither of the lists.  Should it be?
>>>>
>>>> Jeff Wang
>>>> diCarta, Inc.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>>> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
>>>> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>>>>
>>>>
>>>>  
>>>>     
>>>
>>>
>>>
>>>   
>>
>>
>>
>>  
>>
> 
> 


-- 
Andrew C. Oliver
SuperLink Software, Inc.

Java to Excel using POI
http://www.superlinksoftware.com/services/poi
Commercial support including features added/implemented, bugs fixed.

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic