I created a Workbook / Excel in .xlsx format using Java using the Apache POI API. My code is as follows: a file called "RiponAlWasim.xlsx" is created in the D file:
Workbook wb = new XSSFWorkbook();
FileOutputStream fileOut = new FileOutputStream("D:\\RiponAlWasim.xlsx");
wb.write(fileOut);
fileOut.close();
wb.close();
When I tried to open "RiponAlWasim.xlsx", the file was shown to be corrupt. What's wrong?
source
share