I am new as an official user, I always found my answers here but now I have got to ask.
I am working with the last apache-poi 3.8 release (from 2012/03/26) and I have to manipulate a single file with multiple sheets in which only one contains a big amount of data (over 1000 columns and 10 000 rows).
I only need to had more columns to the big sheet. Therefore, with the current tools that exist I should use SAX to read it and SXSSF to rewrite it.
The Excel file is already preformatted with different styles and images in every sheet therefore it will be helpful to be able to make a copy of the file without the big sheet.
There goes my question:
How can I make a copy of sheet with SAX (from the input stream in ) without parsing it?
I tried to do like in here but the field sheets
in XSSFWorkbook
has a visibility set to private.
The awesome thing would be to have something like a SXSSFWriter.SheetIterator
if it is in future plans for POI Developers.
Thanks for reading,
Arthur
**Update**
The file is too big to be able to open it as a common XSSFWorkbook (OutOfMemoryException). Could it be possible to create and XSSFSheet from an InputStream? Like in the following:
XSSFReader.SheetIterator iter = (XSSFReader.SheetIterator) xssfReader
.getSheetsData();
int index = 0;
while (iter.hasNext()) {
InputStream stream = iter.next();
String sheetName = iter.getSheetName();
if (!sheetName.equalsIgnoreCase("BigSheetThatIDontWant")) {
Sheet newSheet = new XSSFSheet(stream);
stream.close();
}
++index;
}
Thanks a lot for your answers.