1.@ExcelProperty  - 用于匹配excel和实体类的匹配,参数:value是列名,index是列名的序号,     converter默认自动选择,指定当前字段用什么转换器,默认会自动选择。写的情况下只要实现com.alibaba.excel.converters.Converter#convertToExcelData(com.alibaba.excel.converters.WriteConverterContext<T>) 方法即可。

2.@ColumnWith - 设置列宽,参数最大可以设置255个字符

3.@ContentFontStyle - 设置单元格内容字体格式

参数

含义

fontName

字体名称

fontHeightInPoints

字体高度

italic

是否斜体

strikeout

是否设置删除水平线

color

字体颜色

typeOffset

偏移量

underline

下划线

bold

是否加粗

charset

编码格式

4.@ContentRowHeight - 设置行高,value为-1代表自动行高

5.@ContentStyle - 设置内容格式

参数

含义

dataFormat

日期格式

hidden

设置单元格使用此样式隐藏

locked

设置单元格使用此样式锁定

quotePrefix

在单元格前面增加`符号,数字或公式将以字符串形式展示

horizontalAlignment

设置是否水平居中

wrapped

设置文本是否应换行。将此标志设置为true通过在多行上显示使单元格中的所有内容可见

verticalAlignment

设置是否垂直居中

rotation

设置单元格中文本旋转角度。03版本的Excel旋转角度区间为-90°90°,07版本的Excel旋转角度区间为0°180°

indent

设置单元格中缩进文本的空格数

borderLeft

设置左边框的样式

borderRight

设置右边框样式

borderTop

设置上边框样式

borderBottom

设置下边框样式

leftBorderColor

设置左边框颜色

rightBorderColor

设置右边框颜色

topBorderColor

设置上边框颜色

bottomBorderColor

设置下边框颜色

fillPatternType

设置填充类型

fillBackgroundColor

设置背景色

fillForegroundColor

设置前景色

shrinkToFit

设置自动单元格自动大小

6.@HeadFontStyle - 设置标题字体格式

参数

含义

fontName

设置字体名称

fontHeightInPoints

设置字体高度

italic

设置字体是否斜体

strikeout

是否设置删除线

color

设置字体颜色

typeOffset

设置偏移量

underline

设置下划线

charset

设置字体编码

bold

设置字体是否加粗

7.@HeadRowHeight - 设置标题行行高,value为-1代表自动标题行高

8.@HeadStyle - 设置标题样式

参数

含义

dataFormat

日期格式

hidden

设置单元格使用此样式隐藏

locked

设置单元格使用此样式锁定

quotePrefix

在单元格前面增加`符号,数字或公式将以字符串形式展示

horizontalAlignment

设置是否水平居中

wrapped

设置文本是否应换行。将此标志设置为true通过在多行上显示使单元格中的所有内容可见

verticalAlignment

设置是否垂直居中

rotation

设置单元格中文本旋转角度。03版本的Excel旋转角度区间为-90°90°,07版本的Excel旋转角度区间为0°180°

indent

设置单元格中缩进文本的空格数

borderLeft

设置左边框的样式

borderRight

设置右边框样式

borderTop

设置上边框样式

borderBottom

设置下边框样式

leftBorderColor

设置左边框颜色

rightBorderColor

设置右边框颜色

topBorderColor

设置上边框颜色

bottomBorderColor

设置下边框颜色

fillPatternType

设置填充类型

fillBackgroundColor

设置背景色

fillForegroundColor

设置前景色

shrinkToFit

设置自动单元格自动大小

9.@ExcelIgnore - 忽略该字段转换成Excel列名属性

10.@ExcelIgnoreUnannotated - 没有注解的字段都不转换