You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by GitBox <gi...@apache.org> on 2020/05/29 16:39:35 UTC

[GitHub] [poi] bosofelipe edited a comment on pull request #154: [bug-57342] Excel compatible Zip64 implementation

bosofelipe edited a comment on pull request #154:
URL: https://github.com/apache/poi/pull/154#issuecomment-636070287


   @rzymek my current code failed
   
   `import java.io.File;
   import java.io.FileOutputStream;
   
   import org.apache.commons.compress.archivers.zip.Zip64Mode;
   import org.apache.poi.ss.usermodel.Row;
   import org.apache.poi.xssf.streaming.SXSSFWorkbook;
   
   public class TestExcel {
   
   	public static void main(String[] args) throws Exception {
   		SXSSFWorkbook workbook = null;
   		workbook = new SXSSFWorkbook(null, 10000, true, false);
   		workbook.setZip64Mode(Zip64Mode.Always);
   		int ROWS_COUNT = 37000;
   		int COLS_COUNT = 2500;
   
   		org.apache.poi.ss.usermodel.Sheet sheet = workbook.createSheet("1");
   		for (int i = 1; i <= ROWS_COUNT; i++) {
   			Row row = sheet.createRow(i);
   			for (int j = 1; j <= COLS_COUNT; j++) {
   				row.createCell(j).setCellValue("1");
   				System.out.println(i + " " + j);
   			}
   		}
   
   		FileOutputStream out = new FileOutputStream("~/Downloads/Excel.xlsx");
   		workbook.write(out);
   		out.close();
   		workbook.close();
   		workbook.dispose();
   
   		File file = new File("~/Downloads/Excel.xlsx");
   		System.out.println(file.length());
   
   	}
   }`


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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