基于alibaba/easyexcel
进行样式扩展封装而来的,增加了一些样式注解
可以解决什么问题
- 注解式样式
- 代码自定义单元格样式处理链 -> addCustomCellStyleHandler
- 冻结行列样式
- 合并单元格样式
- 设置内容下拉框
- 背景颜色
- 字体设置
- 列宽度设置
- 边框样式
- 居中方式
- 是否换行
效果
DEMO
model代码示例
@CellFreeze(freezeRow = 2, freezeCol = 2)
// 宽度默认值
@ColumnWidth(width = 40)
// 同时作用于表标题和内容的样式默认值
@CellStyle(fontStyle = @FontStyle(color = IndexedColors.LIGHT_BLUE, size = 14))
public class MyModel1 extends BaseRowModel {
// easyexcel 解析注解
@ExcelProperty(value={"pri", "pr1"}, index = 0)
pri