预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共31页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

基于poi3.8各个poi方法详解 1、 packagecom.rensanning.poi; importjava.io.FileInputStream; importjava.io.FileOutputStream; importjava.io.IOException; importorg.apache.poi.openxml4j.exceptions.InvalidFormatException; importorg.apache.poi.ss.usermodel.Workbook; importorg.apache.poi.ss.usermodel.WorkbookFactory; publicabstractclassAbstractSample{ publicWorkbookreadExcelFile(Stringfilename){ FileInputStreamin=null; Workbookwb=null; try{ in=newFileInputStream(filename); wb=WorkbookFactory.create(in); }catch(IOExceptione){ System.out.println(e.toString()); }catch(InvalidFormatExceptione){ System.out.println(e.toString()); }finally{ try{ in.close(); }catch(IOExceptione){ System.out.println(e.toString()); } } returnwb; } publicvoidcreateExcelFile(Workbookwb,Stringfilename){ FileOutputStreamout=null; try{ out=newFileOutputStream(filename); wb.write(out); }catch(IOExceptione){ System.out.println(e.toString()); }finally{ try{ out.close(); }catch(IOExceptione){ System.out.println(e.toString()); } } } } 2、 packagecom.rensanning.poi; importjava.io.BufferedInputStream; importjava.io.File; importjava.io.FileInputStream; importjava.io.FileNotFoundException; importjava.io.IOException; importorg.apache.poi.hssf.record.crypto.Biff8EncryptionKey; importorg.apache.poi.hssf.usermodel.HSSFSheet; importorg.apache.poi.hssf.usermodel.HSSFWorkbook; importorg.apache.poi.openxml4j.exceptions.InvalidFormatException; importorg.apache.poi.poifs.filesystem.POIFSFileSystem; importorg.apache.poi.ss.usermodel.Sheet; importorg.apache.poi.ss.usermodel.Workbook; importorg.apache.poi.ss.usermodel.WorkbookFactory; importorg.apache.poi.xssf.usermodel.XSSFWorkbook; publicclassT1_WorkbookextendsAbstractSample{ privatestaticStringFILE_DIR="c:\\sample\\poi\\"; privatestaticfinalStringTEST_WORKBOOK_NAME=FILE_DIR+"sample_workbook.xls"; privatestaticfinalStringTEST_WORKBOOK_NAME2=FILE_DIR+"sample_workbook.xlsx";