Apache POI, using both XSSF and HSSF

前端 未结 4 1155
暖寄归人
暖寄归人 2021-01-02 13:07

I have a problem with Apache POI project.

I failed to use XSSF and HSSF in the \"Same Java Class\". Which jar should I dow

4条回答
  •  一整个雨季
    2021-01-02 13:29

    Use the factory instead which handles both xssf and hssf

    import org.apache.poi.ss.usermodel.Workbook;
    import org.apache.poi.ss.usermodel.WorkbookFactory;
    
    Workbook wb = WorkbookFactory.create(new File("file"))
    

提交回复
热议问题