Skip to content

Instantly share code, notes, and snippets.

@rjdkolb
Last active December 8, 2015 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjdkolb/56c3c0cf4929b0d2bcf6 to your computer and use it in GitHub Desktop.
Save rjdkolb/56c3c0cf4929b0d2bcf6 to your computer and use it in GitHub Desktop.
Generate a 12 meg XLSX file 60000x85 columns
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