public class ExeclTool extends Object
┌─┐ ┌─┐
┌──┘ ┴───────┘ ┴──┐
│ │
│ ─── │
│ ─┬┘ └┬─ │
│ │
│ ─┴─ │
│ │
└───┐ ┌───┘
│ │
│ │
│ │
│ └──────────────┐
│ │
│ ├─┐
│ author:lelouch ┌─┘
│ │
└─┐ ┐ ┌───────┬──┐ ┌──┘
│ ─┤ ─┤ │ ─┤ ─┤
└──┴──┘ └──┴──┘
神兽保佑
代码无BUG!
| 构造器和说明 |
|---|
ExeclTool()
文件流方式
|
ExeclTool(File file)
新文件
模板文件:Play.applicationPath + "/app/others/commons/ExeclTool/ExeclTool.xls" |
ExeclTool(File file,
File fileTemplate)
新文件,模板文件
|
| 限定符和类型 | 方法和说明 |
|---|---|
jxl.write.WritableCellFormat |
F_date()
自定义格式:日期
|
jxl.write.WritableCellFormat |
F_num()
自定义格式:th
用法:sheet.addCell(new jxl.write.Number(int c, int r, String cont, CellFormat st)) |
jxl.write.WritableCellFormat |
F_percent()
自定义格式:百分比
|
jxl.write.WritableCellFormat |
F_td()
自定义格式:td
用法:sheet.addCell(new Label(int c, int r, String cont, CellFormat st)) |
jxl.write.WritableCellFormat |
F_th()
自定义格式:th
用法:sheet.addCell(new Label(int c, int r, String cont, CellFormat st)) |
static jxl.Sheet |
getSheet(File ExeclToolfile)
读取ExeclTool Sheet
默认读 sheet0 |
static jxl.Sheet |
getSheet(File ExeclToolfile,
int sheetNo)
读取ExeclTool Sheet
|
File |
getWritableSheetFile()
获取生成文件
文件方式 |
File |
getWritableSheetFile(File newFile)
文件流方式 |
ByteArrayInputStream |
getWritableSheetIn()
获取ByteArrayInputStream
文件流方式 |
void |
init() |
void |
IO_init() |
static void |
main(String[] args) |
static String[][] |
readSheet(jxl.Sheet sheet)
读取sheet
|
void |
setTitleRow(String[] column)
设置标题行
|
void |
setTitleRow(String[] column,
int row)
设置标题行
|
void |
setTitleRow(String[] column,
int[] width)
设置标题行
|
jxl.write.WritableSheet |
setWritableSheet()
获取sheet
|
public ExeclTool()
throws jxl.write.biff.RowsExceededException,
IOException
jxl.write.biff.RowsExceededExceptionIOExceptionpublic ExeclTool(File file) throws jxl.write.biff.RowsExceededException, jxl.read.biff.BiffException, IOException
file - IOExceptionjxl.read.biff.BiffExceptionjxl.write.biff.RowsExceededExceptionpublic ExeclTool(File file, File fileTemplate) throws jxl.write.biff.RowsExceededException, jxl.read.biff.BiffException, IOException
file - fileTemplate - IOExceptionjxl.read.biff.BiffExceptionjxl.write.biff.RowsExceededExceptionpublic void init()
throws jxl.read.biff.BiffException,
IOException,
jxl.write.biff.RowsExceededException
jxl.read.biff.BiffExceptionIOExceptionjxl.write.biff.RowsExceededExceptionpublic void IO_init()
throws IOException,
jxl.write.biff.RowsExceededException
IOExceptionjxl.write.biff.RowsExceededExceptionpublic jxl.write.WritableSheet setWritableSheet()
public void setTitleRow(String[] column, int row) throws jxl.write.biff.RowsExceededException, jxl.write.WriteException
column - 列名row - 第几行jxl.write.biff.RowsExceededExceptionjxl.write.WriteExceptionpublic void setTitleRow(String[] column) throws jxl.write.biff.RowsExceededException, jxl.write.WriteException
column - 列名jxl.write.biff.RowsExceededExceptionjxl.write.WriteExceptionpublic void setTitleRow(String[] column, int[] width) throws jxl.write.biff.RowsExceededException, jxl.write.WriteException
column - 列名width - 宽度jxl.write.biff.RowsExceededExceptionjxl.write.WriteExceptionpublic ByteArrayInputStream getWritableSheetIn() throws IOException, jxl.write.WriteException
IOExceptionjxl.write.WriteExceptionpublic File getWritableSheetFile() throws IOException, jxl.write.WriteException
sheet - IOExceptionjxl.write.WriteExceptionpublic File getWritableSheetFile(File newFile) throws jxl.write.WriteException, IOException
newFile - jxl.write.WriteExceptionIOExceptionpublic jxl.write.WritableCellFormat F_th()
throws jxl.write.WriteException
jxl.write.WriteExceptionpublic jxl.write.WritableCellFormat F_td()
throws jxl.write.WriteException
jxl.write.WriteExceptionpublic jxl.write.WritableCellFormat F_num()
throws jxl.write.WriteException
jxl.write.WriteExceptionpublic jxl.write.WritableCellFormat F_date()
throws jxl.write.WriteException
jxl.write.WriteExceptionpublic jxl.write.WritableCellFormat F_percent()
throws jxl.write.WriteException
jxl.write.WriteExceptionpublic static jxl.Sheet getSheet(File ExeclToolfile, int sheetNo) throws jxl.read.biff.BiffException, IOException
ExeclToolfile - sheetNo - sheet编号jxl.read.biff.BiffExceptionIOExceptionpublic static jxl.Sheet getSheet(File ExeclToolfile) throws jxl.read.biff.BiffException, IOException
ExeclToolfile - jxl.read.biff.BiffExceptionIOExceptionpublic static String[][] readSheet(jxl.Sheet sheet)
sheet - public static void main(String[] args) throws jxl.read.biff.BiffException, IOException, jxl.write.WriteException
jxl.read.biff.BiffExceptionIOExceptionjxl.write.WriteExceptionCopyright © 2020. All rights reserved.