zoukankan      html  css  js  c++  java
  • (一)POI-新建excel文件

    原文:https://blog.csdn.net/class157/article/details/92799521

    package com.java.poi;
     
    import org.apache.poi.hssf.usermodel.HSSFWorkbook;
    import org.apache.poi.ss.usermodel.Workbook;
     
     
    import java.io.FileOutputStream;
     
    /**
     * @program: IdeaProjects
     * @description:
     * @author: Lxy
     * @create: 2019-06-18 20:04
     **/
    public class Test1 {
        public static void main(String[] args) throws Exception {
            //创建实例,新建一个工作簿
            Workbook workbook = new HSSFWorkbook();
            //建立输出流,设置创建的Excel的输出路径:D:poi你好.xls
            FileOutputStream fileOutputStream = new FileOutputStream("D:\poi你好.xls");
            ((HSSFWorkbook) workbook).write(fileOutputStream);
            //关闭输出流
            fileOutputStream.close();
        }
    }
    

    运行main方法后,D盘会生成一个名字为poi你好的文件。

  • 相关阅读:
    python之道04
    python之list [ 列表 ]
    end和sep的使用方法
    pass1
    python之for (循环)
    python之range (范围)
    python之str (字符型)
    python之bool (布尔值)
    python之int (整型)
    python之道03
  • 原文地址:https://www.cnblogs.com/lvchengda/p/12941338.html
Copyright © 2011-2022 走看看