Last active
December 8, 2015 11:46
-
-
Save rjdkolb/56c3c0cf4929b0d2bcf6 to your computer and use it in GitHub Desktop.
Generate a 12 meg XLSX file 60000x85 columns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<String> list = new ArrayList<>(); | |
for (int count = 0; count < 60000; count++) { | |
list.add("T " + count); | |
} | |
SXSSFWorkbook workbook = new SXSSFWorkbook(); | |
SXSSFSheet sheet = workbook.createSheet("FIELD OPERATIONS TRACKER"); | |
for (int i = 0; i < list.size(); i++) { | |
SXSSFRow rowHeader = sheet.createRow(i); | |
for (int cellcount = 0; cellcount < 85; cellcount++) { | |
SXSSFCell cell = rowHeader.createCell(cellcount); | |
cell.setCellValue(list.get(i)); | |
} | |
} | |
FileOutputStream fileOutputStream = new FileOutputStream(File.createTempFile("xxxxx", ".xlsx")); | |
workbook.write(fileOutputStream); | |
fileOutputStream.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment