> > Am Do 03.11.2005 20:08 schrieb Tobias Meyer <tm <at> allocation.net>:
> > > I'm using poi-2.5.1-final to generate an excel sheet with 
> > 92 columns -
> > > text,
> > > numbers, booleans and dates.
> > > The problem occurs, if I use the UTF_16 encoding (which I need for
> > > chinese
> > > letters), but not if I use HSSFCell.ENCODING_COMPRESSED_UNICODE.
> > > 
> > > Excel completely refuses to open the generated file with an error
> > > message
> > > "not enough memory" (a translation from german, so this propably is
> > > not the
> > > exact message).
> > > OpenOffice can open the file, but has many cells with "*** ERROR IN
> > > SST
> > > ***", starting in row 628 of approximately 6500, in column 72. (that
> > > is cell
> > > nr. 57756).
> > > 
...
> > > 
> > > Has anyone seen similar behaviour before?
> > > What can I do to investigate further?
> > > 
> > > Thanks a lot,
> > > Tobias
Tobias Meyer <tm <at> allocation.net> writes:
... 
> I circumvent the problem now, by checking each String for unicode characters
> (high byte != 0), and only use cell.setEncoding(...UTF_16...) if necessary.
...
> 

Hello,

I recently encountered a similar problem and thought I could 
at least document my circumstances on the off chance it helps illuminate 
the core issue.

I am using the poi-2.5.1-final library as part of the displaytag 1.1 
utility (http://displaytag.sourceforge.net) to export a table of java 
objects to an Excel file.  Specifically, I am using the
displaytag-export-poi-1.1.jar to export data in Excel binary 
format (using POI).

Like Tobias, the Excel sheets I generate contain less than 100 rows 
of mostly string data with some numbers and dates.  When I try to 
open the sheets in Excel, I get an error dialog stating: "Excel 
cannot complete this task with available resources.  Choose less 
data or close other applications".  

When I open the sheets in OpenOffice, it displays 
"*** ERROR IN SST ***" in some of the cells.  

When I open the files using a slightly modified 
ReadWriteWorkbook class from the POI examples, 
I get the following exception:

Exception in thread "main" java.lang.NullPointerException
    at org.apache.poi.hssf.record.SSTRecord.getString
(SSTRecord.java:277)
    at org.apache.poi.hssf.model.Workbook.getSSTString
(Workbook.java:649)
    at org.apache.poi.hssf.usermodel.HSSFCell.<init>
(HSSFCell.java:283)
    at org.apache.poi.hssf.usermodel.HSSFRow.createCellFromRecord
(HSSFRow.java:198)
    at org.apache.poi.hssf.usermodel.HSSFSheet.setPropertiesFromSheet
(HSSFSheet.java:156)
    at org.apache.poi.hssf.usermodel.HSSFSheet.<init>
(HSSFSheet.java:110)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
(HSSFWorkbook.java:177)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
(HSSFWorkbook.java:130)
    at ReadWriteWorkbook.main
(ReadWriteWorkbook.java:42)
 

The displaytag-export-poi-1.1.jar utility calls 
setEncoding(...UTF_16...) for each HSSFCell it writes.  
If I remove the setEncoding calls (like Tobias did), I am able 
to generate readable Excel files.  I also noticed that if 
I sort the same data differently (before producing the Excel file) 
I am able to generate readable Excel files.  
Finally, adding 40+ rows to the beginning of the data
also seemed to "correct" the problem.

I don't need the UTF-16 encoding, so I will use that workaround.  
However, it would be nice to know what's really happening here.

Regards,
Eric Trautman


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

Reply via email to