easyexcel注解样式无效_easyexcel注解

更新时间:2023-07-17 10:15:55 阅读: 评论:0

easyexcel注解样式⽆效_easyexcel注解11个注解
@ExcelProperty
@ColumnWith 列宽
@ContentFontStyle ⽂本字体样式
微信怎么分享音乐@ContentLoopMerge ⽂本合并
@ContentRowHeight ⽂本⾏⾼度
@ContentStyle ⽂本样式
@HeadFontStyle 标题字体样式
@HeadRowHeight 标题⾼度
@HeadStyle 标题样式
@ExcelIgnore 忽略项
@ExcelIgnoreUnannotated 忽略未注解
字段注解
类注解
相似三角形符号
@ColumnWith(列宽)
@ColumnWidth(全局列宽)
@ExcelProperty(字段配置)
@HeadFontStyle(头样式)
@HeadRowHeight(标题⾼度)
@ContentFontStyle(内容字体样式)
@ContentRowHeight(内容⾼度)
@ExcelProperty
必要的⼀个注解,注解中有三个参数value,index,converter分别代表列明,列序号,数据转换⽅式
value和index只能⼆选⼀,通常不⽤设置converter
1.value 通过标题⽂本对应
2.index 通过⽂本⾏号对应
最佳实践
public class ImeiEncrypt {
@ExcelProperty(value = "值")
private String valueField;
@ExcelProperty(value = 1,converter =IndustryIdConverter.class)
private String indexField;
@ExcelProperty(value = "值对应和转换器",converter =IndustryIdConverter.class)
private String valueAndConverterField;
}
@ColumnWith
设置列宽度,只有⼀个参数value,value的单位是字符长度,最⼤可以设置255个字符,因为⼀个excel单元格最⼤可以写⼊的字符个数就是255个字符。
最佳实践
public class ImeiEncrypt {
@ColumnWidth(value = 18)
private String imei;
}
@ContentFontStyle
男生和女生聊天⽤于设置单元格内容字体格式的注解
参数:
参数
含义
fontName
字体名称
fontHeightInPoints
字体⾼度
italic
是否斜体
strikeout
是否设置删除⽔平线
color
字体颜⾊
typeOfft
偏移量
underline
下划线
bold
是否加粗
chart
编码格式
@ContentLoopMerge
⽤于设置合并单元格的注解学生综合素质评价怎么写
参数:
参数
含义
eachRow
columnExtend
@ContentRowHeight
⽤于设置⾏⾼
参数:
参数
含义
value
⾏⾼,-1代表⾃动⾏⾼
@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
设置⾃动单元格⾃动⼤⼩
@HeadFontStyle
⽤于定制标题字体格式
参数
含义
fontName
设置字体名称
fontHeightInPoints
设置字体⾼度
italic
设置字体是否斜体
strikeout
是否设置删除线
color
设置字体颜⾊
typeOfft
设置偏移量
underline
设置下划线
chart
设置字体编码
bold
设置字体是否加粗
@HeadRowHeight
设置标题⾏⾏⾼
参数
含义
value
设置⾏⾼,-1代表⾃动⾏⾼
@HeadStyle
设置标题样式
参数
含义
dataFormat
⽇期格式
hidden
设置单元格使⽤此样式隐藏
locked
设置单元格使⽤此样式锁定
quotePrefix
惬意生活
在单元格前⾯增加`符号,数字或公式将以字符串形式展⽰horizontalAlignment

本文发布于:2023-07-17 10:15:55,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1084930.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:设置   字体   样式
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图