Export excel super simple version

    /**
     * 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();
    }

 

Guess you like

Origin www.cnblogs.com/tanyucong/p/11776960.html