ITeye博客

poi兼容excel2003和2007写法

_____bEn-beN · 2015-01-19 15:45 · 编程语言 · Markdown

//创建excel文件薄对象

            Workbook workBook;

            

            fileInputStream = new FileInputStream(phonesUrl);

            

            try 

            {

                //读取exl 2007

                workBook = new XSSFWorkbook(fileInputStream);

            } 

            catch (Exception ex) 

            {

                //读取exl 2003

                fileInputStream.close();

                fileInputStream = new FileInputStream(phonesUrl);

                workBook = new HSSFWorkbook(fileInputStream);

            }

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。