Bug 23628 - Excel cannot open HSSF file with 30,000 rows generated by POI
Summary: Excel cannot open HSSF file with 30,000 rows generated by POI
Status: RESOLVED DUPLICATE of bug 15375
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.0-pre3
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-06 17:23 UTC by Robert Lowe
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments
Test case (test runs without errors, but Excel 2000 cannot open output document) (845 bytes, text/plain)
2003-10-06 17:25 UTC, Robert Lowe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Lowe 2003-10-06 17:23:35 UTC
Initially, OutOfMemory errors were encountered, however after increasing the JVM
heap size the program that generates the HSSF file appeared to run correctly.
However, Excel 2000 cannot open the output file produced. (There's no error
message--the document window just flashes up on the screen for a split
second before disappearing.)

Below is a simple test case that demonstrates the problem:

================================================================================
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;


public final class HssfTest {
	public static final void main(final String[] args) throws IOException {
		final HSSFWorkbook wb = new HSSFWorkbook();
		final HSSFSheet sheet = wb.createSheet();
		for (int i = 0; i < 30000; i++) {
			final HSSFRow row = sheet.createRow(i);
			final HSSFCell cell = row.createCell((short) 0);
			cell.setCellValue(Integer.toString(i));
		}
		final OutputStream out = new FileOutputStream(new File
("C:\\test.xls"));
		try {
			wb.write(out);
		} finally {
			out.close();
		}
	}
}
Comment 1 Robert Lowe 2003-10-06 17:25:16 UTC
Created attachment 8469 [details]
Test case (test runs without errors, but Excel 2000 cannot open output document)
Comment 2 Jason Height 2003-10-06 22:09:22 UTC

*** This bug has been marked as a duplicate of 15375 ***