类 ExcelBigExport
java.lang.Object
com.sh.common.util.ExportBase
com.sh.common.util.ExcelBigExport
Description: Excel文件处理工具类,分页导出,防止内存溢出,同时导出速度较慢
Title:首亨软件
Company:首亨软件(重庆)有限公司
-
字段概要
字段从类继承的字段 com.sh.common.util.ExportBase
CHARSET_GBK, CHARSET_ISSO_8859_1, CHARSET_UTF_8, DEFAULT_CHARSET, ENABLE_DOWNLOAD_MAX_NUM, freshDsObj, FTNEXS_DIR, SHEET_MAX_ROW, TO_FTNEXS_FILES, TO_FTNEXS_TASK -
构造器概要
构造器构造器说明ExcelBigExport(DataCenter dc, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String sql, String[][] excelTitle, String[] excelCols) 构造函数ExcelBigExport(DataCenter dc, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String sql, String[] colsType, Object[] obj, String[][] excelTitle, String[] excelCols) 构造函数ExcelBigExport(DataCenter dc, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String sql, String[] colsType, Object[] obj, String[] excelTitle, String[] excelCols) 构造函数ExcelBigExport(DataCenter dc, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String sql, String[] excelTitle, String[] excelCols) 构造函数ExcelBigExport(DataCenter dc, File file, String sql, String[][] excelTitle, String[] excelCols) ExcelBigExport(DataCenter dc, File file, String sql, String[] colsType, Object[] obj, String[][] excelTitle, String[] excelCols) ExcelBigExport(DataCenter dc, File file, String sql, String[] colsType, Object[] obj, String[] excelTitle, String[] excelCols) ExcelBigExport(DataCenter dc, File file, String sql, String[] excelTitle, String[] excelCols) ExcelBigExport(DataCenter dc, OutputStream outputStream, String sql, String[][] excelTitle, String[] excelCols) ExcelBigExport(DataCenter dc, OutputStream outputStream, String sql, String[] colsType, Object[] obj, String[][] excelTitle, String[] excelCols) ExcelBigExport(DataCenter dc, OutputStream outputStream, String sql, String[] colsType, Object[] obj, String[] excelTitle, String[] excelCols) ExcelBigExport(DataCenter dc, OutputStream outputStream, String sql, String[] excelTitle, String[] excelCols) ExcelBigExport(Datastore ds, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String[][] excelTitle, String[] excelCols) ExcelBigExport(Datastore ds, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String[] colsType, Object[] obj, String[][] excelTitle, String[] excelCols) ExcelBigExport(Datastore ds, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String[] colsType, Object[] obj, String[] excelTitle, String[] excelCols) ExcelBigExport(Datastore ds, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String[] excelTitle, String[] excelCols) ExcelBigExport(Datastore ds, File file, String[][] excelTitle, String[] excelCols) ExcelBigExport(Datastore ds, File file, String[] colsType, Object[] obj, String[][] excelTitle, String[] excelCols) ExcelBigExport(Datastore ds, File file, String[] colsType, Object[] obj, String[] excelTitle, String[] excelCols) ExcelBigExport(Datastore ds, File file, String[] excelTitle, String[] excelCols) ExcelBigExport(Datastore ds, OutputStream outputStream, String[][] excelTitle, String[] excelCols) ExcelBigExport(Datastore ds, OutputStream outputStream, String[] colsType, Object[] obj, String[][] excelTitle, String[] excelCols) ExcelBigExport(Datastore ds, OutputStream outputStream, String[] colsType, Object[] obj, String[] excelTitle, String[] excelCols) ExcelBigExport(Datastore ds, OutputStream outputStream, String[] excelTitle, String[] excelCols) ExcelBigExport(jakarta.servlet.http.HttpServletResponse response) ExcelBigExport(OutputStream outputStream) -
方法概要
修饰符和类型方法说明voidvoidcreateSheet(int rows) 创建sheetvoiddoExport()void执行导出操作getDc()voidmergeHeaderCells(int col1, int row1, int col2, int row2) 设置合并单元格voidmergeHeaderCells(ExcelMerge mergeCell) 合并表头单元格voidsetCellStyle(ExcelBigCellStyle style) 设置单元格样式voidsetCharset(String charset) 设置编码voidsetColumnWidth(int col, int width) 设置宽度从类继承的方法 com.sh.common.util.ExportBase
getRefreshDsObj, refreshDs, refreshDs, setRefreshDs
-
字段详细资料
-
log4j
protected org.apache.logging.log4j.Logger log4j -
EXPORT_PAGE_ROWS
public static int EXPORT_PAGE_ROWS
-
-
构造器详细资料
-
ExcelBigExport
public ExcelBigExport(DataCenter dc, File file, String sql, String[] excelTitle, String[] excelCols) throws Exception - 抛出:
Exception
-
ExcelBigExport
public ExcelBigExport(DataCenter dc, OutputStream outputStream, String sql, String[] excelTitle, String[] excelCols) -
ExcelBigExport
public ExcelBigExport(DataCenter dc, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String sql, String[] excelTitle, String[] excelCols) 构造函数- 参数:
dc- 数据中心request- HttpServletRequestresponse- HttpServletResponsesql- 导出SQLexcelTitle- EXCEL中标题行excelCols- 每列对应DS中的列名
-
ExcelBigExport
public ExcelBigExport(DataCenter dc, File file, String sql, String[][] excelTitle, String[] excelCols) throws Exception - 抛出:
Exception
-
ExcelBigExport
public ExcelBigExport(DataCenter dc, OutputStream outputStream, String sql, String[][] excelTitle, String[] excelCols) -
ExcelBigExport
public ExcelBigExport(DataCenter dc, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String sql, String[][] excelTitle, String[] excelCols) 构造函数- 参数:
dc- 数据中心request- HttpServletRequestresponse- HttpServletResponsesql- 导出SQLexcelTitle- EXCEL中标题行excelCols- 每列对应DS中的列名
-
ExcelBigExport
public ExcelBigExport(DataCenter dc, File file, String sql, String[] colsType, Object[] obj, String[] excelTitle, String[] excelCols) throws Exception - 抛出:
Exception
-
ExcelBigExport
public ExcelBigExport(DataCenter dc, OutputStream outputStream, String sql, String[] colsType, Object[] obj, String[] excelTitle, String[] excelCols) -
ExcelBigExport
public ExcelBigExport(DataCenter dc, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String sql, String[] colsType, Object[] obj, String[] excelTitle, String[] excelCols) 构造函数- 参数:
dc- 数据中心request- HttpServletRequestresponse- HttpServletResponsesql- 导出SQLcolsType- 查询参数类型obj- 查询参数excelTitle- EXCEL中标题行excelCols- 每列对应DS中的列名
-
ExcelBigExport
public ExcelBigExport(DataCenter dc, File file, String sql, String[] colsType, Object[] obj, String[][] excelTitle, String[] excelCols) throws Exception - 抛出:
Exception
-
ExcelBigExport
public ExcelBigExport(DataCenter dc, OutputStream outputStream, String sql, String[] colsType, Object[] obj, String[][] excelTitle, String[] excelCols) -
ExcelBigExport
public ExcelBigExport(DataCenter dc, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String sql, String[] colsType, Object[] obj, String[][] excelTitle, String[] excelCols) 构造函数- 参数:
dc- 数据中心request- HttpServletRequestresponse- HttpServletResponsesql- 导出SQLcolsType- 查询参数类型obj- 查询参数excelTitle- EXCEL中标题行excelCols- 每列对应DS中的列名
-
ExcelBigExport
public ExcelBigExport(Datastore ds, File file, String[] excelTitle, String[] excelCols) throws Exception - 抛出:
Exception
-
ExcelBigExport
public ExcelBigExport(Datastore ds, OutputStream outputStream, String[] excelTitle, String[] excelCols) -
ExcelBigExport
-
ExcelBigExport
public ExcelBigExport(Datastore ds, File file, String[][] excelTitle, String[] excelCols) throws Exception - 抛出:
Exception
-
ExcelBigExport
public ExcelBigExport(Datastore ds, OutputStream outputStream, String[][] excelTitle, String[] excelCols) -
ExcelBigExport
-
ExcelBigExport
public ExcelBigExport(Datastore ds, File file, String[] colsType, Object[] obj, String[] excelTitle, String[] excelCols) throws Exception - 抛出:
Exception
-
ExcelBigExport
-
ExcelBigExport
-
ExcelBigExport
public ExcelBigExport(Datastore ds, File file, String[] colsType, Object[] obj, String[][] excelTitle, String[] excelCols) throws Exception - 抛出:
Exception
-
ExcelBigExport
-
ExcelBigExport
-
ExcelBigExport
-
ExcelBigExport
public ExcelBigExport(jakarta.servlet.http.HttpServletResponse response)
-
-
方法详细资料
-
setCharset
设置编码- 参数:
charset- String
-
setColumnWidth
public void setColumnWidth(int col, int width) 设置宽度- 参数:
col- 列号 从0开始width- 宽度
-
createSheet
public void createSheet(int rows) 创建sheet- 参数:
rows- int
-
doExport
- 抛出:
Exception
-
doExport
执行导出操作- 参数:
fileName- 导出文件名- 抛出:
Exception- Exception
-
mergeHeaderCells
合并表头单元格- 参数:
mergeCell- ExcelMerge
-
mergeHeaderCells
public void mergeHeaderCells(int col1, int row1, int col2, int row2) 设置合并单元格- 参数:
col1- 起始单元格列号row1- 起始单元格行号col2- 结束单元格列号row2- 结束单元格行号
-
getDc
-
setCellStyle
设置单元格样式- 参数:
style- ExcelBigCellStyle
-
addCell
-