Package cn.net.pap.common.excel.handle
Class ImageModifyHandler
java.lang.Object
cn.net.pap.common.excel.handle.ImageModifyHandler
- All Implemented Interfaces:
com.alibaba.excel.event.Handler
,com.alibaba.excel.event.Order
,com.alibaba.excel.write.handler.CellWriteHandler
,com.alibaba.excel.write.handler.WriteHandler
public class ImageModifyHandler
extends Object
implements com.alibaba.excel.write.handler.CellWriteHandler
图像填充完合并后的单元格 - 如果需要将图像完成填充至一个被合并的单元格,可使用如下方式
使用方式: WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new ImageModifyHandler()).build();
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterCellDataConverted
(com.alibaba.excel.write.metadata.holder.WriteSheetHolder writeSheetHolder, com.alibaba.excel.write.metadata.holder.WriteTableHolder writeTableHolder, com.alibaba.excel.metadata.data.WriteCellData<?> cellData, org.apache.poi.ss.usermodel.Cell cell, com.alibaba.excel.metadata.Head head, Integer relativeRowIndex, Boolean isHead) 后单元格数据转换static int
getMergeColumNum
(org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.Sheet sheet) 得到合并列numstatic int
getMergeRowNum
(org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.Sheet sheet) 得到合并行numMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.alibaba.excel.write.handler.CellWriteHandler
afterCellCreate, afterCellCreate, afterCellDataConverted, afterCellDispose, afterCellDispose, beforeCellCreate, beforeCellCreate
Methods inherited from interface com.alibaba.excel.event.Handler
order
-
Field Details
-
standardCharacterWidth
-
character2PixelFactor
-
pixel2InchFactor
-
dpi
-
rowHeight2PixelFactor
-
-
Constructor Details
-
ImageModifyHandler
public ImageModifyHandler()
-
-
Method Details
-
afterCellDataConverted
public void afterCellDataConverted(com.alibaba.excel.write.metadata.holder.WriteSheetHolder writeSheetHolder, com.alibaba.excel.write.metadata.holder.WriteTableHolder writeTableHolder, com.alibaba.excel.metadata.data.WriteCellData<?> cellData, org.apache.poi.ss.usermodel.Cell cell, com.alibaba.excel.metadata.Head head, Integer relativeRowIndex, Boolean isHead) 后单元格数据转换- Specified by:
afterCellDataConverted
in interfacecom.alibaba.excel.write.handler.CellWriteHandler
- Parameters:
writeSheetHolder
- 写单夹writeTableHolder
- 写表夹cellData
- 单元格数据cell
- 细胞head
- 头relativeRowIndex
- 相对行索引isHead
- 是头
-
getMergeRowNum
public static int getMergeRowNum(org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.Sheet sheet) 得到合并行num- Parameters:
cell
- 细胞sheet
- 表- Returns:
- int
-
getMergeColumNum
public static int getMergeColumNum(org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.Sheet sheet) 得到合并列num- Parameters:
cell
- 细胞sheet
- 表- Returns:
- int
-