Answer the question
In order to leave comments, you need to log in
Error writing a large number of rows in excel??
Approximately at line 32 in excel, it writes the following error: java.lang.NullPointerException, the variable is not empty I
write it this way:
FileInputStream file = new FileInputStream(new File("excel/excel.xlsx"));
XSSFWorkbook workbook = new XSSFWorkbook(file);
XSSFSheet sheet = workbook.getSheetAt(0);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd HH:mm");
for (int i=0;i<statistics.getList().size();i++){
Row row = sheet.getRow(i);
row.createCell(0).setCellValue(dateFormat.format(statistics.getList().get(i+1).getDate()));
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question