poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 23628] New: - Excel cannot open HSSF file with 30,000 rows generated by POI
Date Mon, 06 Oct 2003 17:23:36 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23628>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=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
           Product: POI
           Version: 2.0-pre3
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: HSSF
        AssignedTo: poi-dev@jakarta.apache.org
        ReportedBy: rmlowe@rmlowe.com


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();
		}
	}
}

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


Mime
View raw message