You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by David González Casín <da...@softproject.de> on 2011/08/01 09:34:49 UTC

AW: SXSSF in POI 3.8

Seems to work, thank you!

But why doesn't the WorkbookFactory do that for me? It's not possible for me
to know which constructor with which parameters I should use, so of course I
used the WorkbookFactory to do this for me.

David

-----Ursprüngliche Nachricht-----
Von: Yegor Kozlov [mailto:yegor.kozlov@dinom.ru] 
Gesendet: Donnerstag, 28. Juli 2011 11:29
An: POI Users List
Betreff: Re: SXSSF in POI 3.8

Try to construct your workbook using NPOIFS:

File file = new File("ExcelIn.xls");
Workbook wb = new HSSFWorkbook(new NPOIFSFileSystem(file).getRoot(), true);

Yegor

On Thu, Jul 28, 2011 at 1:02 PM, David González Casín
<da...@softproject.de> wrote:
> As I said, I have the same problem as described in Bug 48261.
>
> I use POI 3.7, I try to open a .xls file (which is built by PHPExcel as
far
> as I know) and I get this error:
>
> true
> Warning, incorrectly terminated empty data blocks in POIFS block listing
> (should end at -2, ended at 0)
>
> I use this test code:
>
> File file = new File("ExcelIn.xls");
> System.out.println(file.exists());
> FileInputStream in = new FileInputStream(file);
> Workbook workbook = WorkbookFactory.create(in);
>
> Is it true, as the last comment on this bug suggests, that POI 3.8 is more
> tolerant and such files can be opened? I can't open the sample file
attached
> in this bug. So I wonder how to get it work.
>
> David
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Yegor Kozlov [mailto:yegor.kozlov@dinom.ru]
> Gesendet: Donnerstag, 28. Juli 2011 10:21
> An: POI Users List
> Betreff: Re: SXSSF in POI 3.8
>
> SXSSF won't help you, it is a API for writing large .xlsx files, not
> for reading.
>
> Please describe your problem in detail.
>
> - What version of POI are you running?
> - What file are you opening? .xls or .xlsx ?
> - Post the stack trace of the exception
>
> Without details we can't do much to help you.
>
> Yegor
>
> On Thu, Jul 28, 2011 at 11:52 AM, David González Casín
> <da...@softproject.de> wrote:
>> Hi,
>>
>>
>>
>> I have the problem to open some Excel files, I guess it's nearly the same
>> problem described here:
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=48261
>>
>>
>>
>> The last answer gives the hint that it can be solved with POI 3.8, but I
>> don't know how. I tried with HSSFWorkbook and XSSFWorkbook, but with both
> it
>> doesn't work (same behavior as in POI 3.7). Then I read something about
>> SXSSFWorkbook, but there are only examples to write an Excel file, not to
>> read. I'm not sure if it is possible with SXSSF at all or if I need
>> something else.
>>
>>
>>
>> Could you help me and give a little code example or a hint?
>>
>>
>>
>> Best regards
>>
>>
>>
>> David
>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> 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
>
>

---------------------------------------------------------------------
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: AW: AW: SXSSF in POI 3.8

Posted by Nick Burch <ni...@alfresco.com>.
On Mon, 1 Aug 2011, David González Casín wrote:
> Ok, thank you! Is there a timetable for the release of POI 3.8?

See the recent discussion on the dev list:
http://mail-archives.apache.org/mod_mbox/poi-dev/201107.mbox/%3CCAAwi-j_KAY=Q4c8NiC-dky0LJG6jwvP+fSEGCM8g4E2rtKgf1w@mail.gmail.com%3E

Nick

AW: AW: SXSSF in POI 3.8

Posted by David González Casín <da...@softproject.de>.
Ok, thank you! Is there a timetable for the release of POI 3.8?

-----Ursprüngliche Nachricht-----
Von: Nick Burch [mailto:nick.burch@alfresco.com] 
Gesendet: Montag, 1. August 2011 11:28
An: POI Users List
Betreff: Re: AW: SXSSF in POI 3.8

On Mon, 1 Aug 2011, David González Casín wrote:
> But why doesn't the WorkbookFactory do that for me?

NPOIFSFileSystem is quite new, so WorkbookFactory defaults to the older and
generally more stable POIFSFileSystem. We probably won't switch the default
until after 3.8 has gone out, and likely not before we finish the write
support in NPOIFS (for now only read support is complete)

Nick


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


Re: AW: SXSSF in POI 3.8

Posted by Nick Burch <ni...@alfresco.com>.
On Mon, 1 Aug 2011, David González Casín wrote:
> But why doesn't the WorkbookFactory do that for me?

NPOIFSFileSystem is quite new, so WorkbookFactory defaults to the older 
and generally more stable POIFSFileSystem. We probably won't switch the 
default until after 3.8 has gone out, and likely not before we finish the 
write support in NPOIFS (for now only read support is complete)

Nick