You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by ms_guruvai <ms...@gmail.com> on 2014/10/21 18:52:08 UTC
To process more than 65536 rows in XSLX file using XSSF reader
I need to upload xslx file having more than 65536 lines with 25 columns in a
single sheet and write in to DB table. I use XSSF Reader event handler API
and OPCpacakage classes for both upload and read. When a file contains
exactly 65536 rows or less it works fine, but when it exceeds 65536 rows,
it's getting corrupted without any exception and table gets loaded with many
rows missing.
Using:
POI 3.9 jars
poi 3.9
poi xml 3.9
poi ooxml schemas 3.9
ooxml_schemas 1.1
xmlbeans 2.3
Is there a limitation on the number of rows that these libraries can
process?
Code:
OPCPackage pkg = OPCPackage.open(System.getProperty("java.io.tmpdir")
+ "/" + demande.getNomFichierDisque());
XSSFReader r = new XSSFReader( pkg );
SharedStringsTable sst = r.getSharedStringsTable();
XMLReader parser = fetchSheetParser(sst);
Iterator<InputStream> sheets = r.getSheetsData();
if(sheets.hasNext()) {
InputStream sheet = sheets.next();
InputSource sheetSource = new InputSource(sheet);
parser.parse(sheetSource);
sheet.close();
}
where event handler startElement and endElement methods will read each cell
and process.
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/To-process-more-than-65536-rows-in-XSLX-file-using-XSSF-reader-tp5716872.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: To process more than 65536 rows in XSLX file using XSSF reader
Posted by Nick Burch <ap...@gagravarr.org>.
On Tue, 21 Oct 2014, ms_guruvai wrote:
> I need to upload xslx file having more than 65536 lines with 25 columns
> in a single sheet and write in to DB table. I use XSSF Reader event
> handler API and OPCpacakage classes for both upload and read. When a
> file contains exactly 65536 rows or less it works fine, but when it
> exceeds 65536 rows, it's getting corrupted without any exception and
> table gets loaded with many rows missing.
It should work fine, and we've quite a few unit tests that cover it. Make
sure you're not using a short as the row counter
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: To process more than 65536 rows in XSLX file using XSSF reader
Posted by Aram Mirzadeh <aw...@mbcli.com>.
You may have to post your code to see where the problem is then.
On Wed, Oct 22, 2014 at 6:43 AM, ms_guruvai <ms...@gmail.com>
wrote:
> Sorry we able to get good rows when file cotanins exactly 65536 rows or
> less
> than that. After that even if we increase one or two rows also we getting
> issue. In table huge rows are missing. we not use any short type variable
> to track rownum. we are not getting any out of memory exception also.
>
>
>
> --
> View this message in context:
> http://apache-poi.1045710.n5.nabble.com/To-process-more-than-65536-rows-in-XSLX-file-using-XSSF-reader-tp5716872p5716882.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>
Re: To process more than 65536 rows in XSLX file using XSSF reader
Posted by ms_guruvai <ms...@gmail.com>.
Sorry we able to get good rows when file cotanins exactly 65536 rows or less
than that. After that even if we increase one or two rows also we getting
issue. In table huge rows are missing. we not use any short type variable
to track rownum. we are not getting any out of memory exception also.
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/To-process-more-than-65536-rows-in-XSLX-file-using-XSSF-reader-tp5716872p5716882.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: To process more than 65536 rows in XSLX file using XSSF reader
Posted by Aram Mirzadeh <aw...@mbcli.com>.
65535 would be the hard limit on short and older xls files.
If you're processing 65538 maybe you're running out of heap space? Try
increase your Xmx.
On Tue, Oct 21, 2014 at 2:07 PM, ms_guruvai <ms...@gmail.com>
wrote:
> yes!. we are not using any short type. still only prcoessiong 65538 rows
> good.
>
>
>
> --
> View this message in context:
> http://apache-poi.1045710.n5.nabble.com/To-process-more-than-65536-rows-in-XSLX-file-using-XSSF-reader-tp5716872p5716874.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>
Re: To process more than 65536 rows in XSLX file using XSSF reader
Posted by ms_guruvai <ms...@gmail.com>.
yes!. we are not using any short type. still only prcoessiong 65538 rows
good.
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/To-process-more-than-65536-rows-in-XSLX-file-using-XSSF-reader-tp5716872p5716874.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org