I tried below code but no good, I am unable to create excel document, open and close it.
package tests;
import java.io.*;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.util.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class Xls_Reader {
Workbook wb = new XSSFWorkbook();
FileOutputStream fileOut = new FileOutputStream("workbook.xlsx");
}
I am getting following error:
Default constructor can not handle exception type FileNotFoundException
thrown by implicit super constructor . Must define an explicit constructor.
Can someone help me understand the concept of creating excel file with POI API?
These examples can help you to understand better