public class DownloadExcelUtil extends Object
| 构造器和说明 |
|---|
DownloadExcelUtil(javax.servlet.http.HttpServletResponse response,
String fileName,
String sheetName)
设置文件名和工作表名(Excel)
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addCell(Integer col,
Integer row,
Object o,
jxl.CellType type,
jxl.biff.DisplayFormat format,
Boolean isLastRow,
Boolean isLastCols)
添加单元格
|
void |
addRow(Object[] strings,
jxl.format.BorderLineStyle borderLineStyle,
jxl.format.Alignment alignment,
String bold)
添加一行
|
void |
addRow(Object[] strings,
jxl.CellType[] cellTypes,
jxl.biff.DisplayFormat... dFormat)
添加一行
|
void |
addRows(List<?> infoList,
jxl.CellType[] cellTypes,
jxl.biff.DisplayFormat... dFormat)
添加多行
|
void |
addSheet(String sheetName) |
void |
close()
关闭资源
|
void |
deleteCol(int rols)
删除列
|
void |
deleteRow(int row)
删除行
|
Integer |
getIcol() |
int |
getIrow() |
int |
getSheetIndex() |
Integer |
getTitleCols() |
void |
osFlush()
释放资源
|
void |
reportExcel()
下载Excel
|
void |
setExcelListTitle(String[] listTitle)
已过时。
|
void |
setHideCol(int rols)
隐藏列
|
void |
setHideRow(int row)
隐藏行
|
void |
setIcol(Integer col) |
void |
setIrow(Integer row) |
void |
setMergeCells(int col,
int row,
int toCol,
int toRow)
合并单元格
|
void |
setReportTitle(String reportTitle)
设置报表标题
|
void |
write()
关闭资源
|
public DownloadExcelUtil(javax.servlet.http.HttpServletResponse response,
String fileName,
String sheetName)
throws IOException
response - 为NULL时,写入磁盘fileName - 文件名sheetName - 工作表名IOExceptionpublic void addSheet(String sheetName)
public void setReportTitle(String reportTitle) throws jxl.write.WriteException, IOException
reportTitle - 报表标题IOExceptionjxl.write.WriteExceptionjxl.write.WriteException@Deprecated public void setExcelListTitle(String[] listTitle) throws jxl.write.WriteException, IOException
listTitle - 报表头IOExceptionjxl.write.WriteExceptionpublic void addRow(Object[] strings, jxl.format.BorderLineStyle borderLineStyle, jxl.format.Alignment alignment, String bold) throws jxl.write.WriteException, IOException
strings - 该行数据IOExceptionjxl.write.WriteExceptionpublic void addRow(Object[] strings, jxl.CellType[] cellTypes, jxl.biff.DisplayFormat... dFormat) throws jxl.write.WriteException, IOException
strings - 该行数据IOExceptionjxl.write.WriteExceptionpublic void addRows(List<?> infoList, jxl.CellType[] cellTypes, jxl.biff.DisplayFormat... dFormat) throws jxl.write.WriteException, IOException
infoList - 报表内容cellTypes - 单元格样式IOExceptionjxl.write.WriteExceptionpublic void reportExcel()
throws jxl.write.WriteException,
IOException
IOExceptionjxl.write.WriteExceptionpublic void setMergeCells(int col,
int row,
int toCol,
int toRow)
throws jxl.write.WriteException,
IOException
col - 起始列row - 起始行toCol - 结束列toRow - 结束行IOExceptionjxl.write.WriteExceptionpublic void close()
throws jxl.write.WriteException,
IOException
jxl.write.WriteExceptionIOExceptionpublic void write()
throws jxl.write.WriteException,
IOException
jxl.write.WriteExceptionIOExceptionpublic void osFlush()
throws IOException,
jxl.write.WriteException
IOExceptionjxl.write.WriteExceptionpublic void addCell(Integer col, Integer row, Object o, jxl.CellType type, jxl.biff.DisplayFormat format, Boolean isLastRow, Boolean isLastCols) throws jxl.write.WriteException, IOException
IOExceptionjxl.write.WriteExceptionpublic void setHideCol(int rols)
public void setHideRow(int row)
throws jxl.write.biff.RowsExceededException
jxl.write.biff.RowsExceededExceptionpublic void deleteCol(int rols)
public void deleteRow(int row)
public void setIrow(Integer row)
public int getIrow()
public void setIcol(Integer col)
public Integer getIcol()
public Integer getTitleCols()
public int getSheetIndex()
Copyright © 2017. All rights reserved.