/** * Super simple to export Excel */ public static void exportExcel() throws Exception{ //导出的文件 OutputStream outputStream = new FileOutputStream(new File("1.xlsx")); // declare a workbook XSSFWorkbook WorkBook = new new XSSFWorkbook (); // create the first page Sheet XSSFSheet Sheet = workBook.createSheet ( "First Sheet" ); // for export flow off workBook.write (outputStream); workBook.close(); outputStream.close(); }