@ExcelProperty

This is one of the most commonly used annotations. There are three parameters in the annotation, value,index, and Conversion mode, respectively. You can only choose one of value and index

Best practices
public class ImeiEncrypt {
    @ExcelProperty(value = "imei")
    private String imei;
}
Copy the code

@ColumnWith

An annotation that sets the column width. The annotation has only one parameter, value, which is in character length. The maximum number of characters that can be written to an Excel cell is 255 characters.

Best practices
public class ImeiEncrypt {
    @ColumnWidth(value = 18)
    private String imei;
}
Copy the code

@ContentFontStyle

Annotations used to format the font for cell content

Parameters:

parameter meaning
fontName The name of the font
fontHeightInPoints The font height
italic Whether in italics
strikeout Whether to set to delete horizontal lines
color The font color
typeOffset The offset
underline The underline
bold Whether the bold
charset Coding format

@ContentLoopMerge

Annotations to set up merged cells

Parameters:

parameter meaning
eachRow
columnExtend

@ContentRowHeight

Set the row height

Parameters:

parameter meaning
value Line is high,- 1Stands for automatic row height

@ContentStyle

Set content formatting annotations

Parameters:

parameter meaning
dataFormat The date format
hidden Set cells to be hidden with this style
locked Set the cell to be locked with this style
quotePrefix Add a symbol to the front of the cell, and a number or formula will be displayed as a string
horizontalAlignment Sets whether to center horizontally
wrapped Sets whether text should be wrapped. Set this flag totrueMake all content in a cell visible by displaying it on multiple lines
verticalAlignment Sets whether to center vertically
rotation Sets the rotation Angle of the cell text. The rotation Angle of Excel 03 ranges from -90° to 90°, and the rotation Angle of Excel 07 ranges from 0° to 180°
indent Sets the number of Spaces for indented text in a cell
borderLeft Styles the left border
borderRight Set the right border style
borderTop Sets the top border style
borderBottom Set the bottom border style
leftBorderColor Sets the left border color
rightBorderColor Set the right border color
topBorderColor Sets the top border color
bottomBorderColor Set the bottom border color
fillPatternType Setting the Fill Type
fillBackgroundColor Set the background color
fillForegroundColor Set the foreground
shrinkToFit Set automatic cell automatic size

@HeadFontStyle

Use to customize the title font format

parameter meaning
fontName Setting the font name
fontHeightInPoints Setting font Height
italic Sets whether the font is italic
strikeout Whether to set a delete line
color Set font color
typeOffset Set offset
underline Set underscores
charset Setting font Encoding
bold Set font whether livestock

@HeadRowHeight

Set the header row height

parameter meaning
value Set the line height. -1 indicates automatic line height

@HeadStyle

Set the title style

parameter meaning
dataFormat The date format
hidden Set cells to be hidden with this style
locked Set the cell to be locked with this style
quotePrefix Add a symbol to the front of the cell, and a number or formula will be displayed as a string
horizontalAlignment Sets whether to center horizontally
wrapped Sets whether text should be wrapped. Set this flag totrueMake all content in a cell visible by displaying it on multiple lines
verticalAlignment Sets whether to center vertically
rotation Sets the rotation Angle of the cell text. The rotation Angle of Excel 03 ranges from -90° to 90°, and the rotation Angle of Excel 07 ranges from 0° to 180°
indent Sets the number of Spaces for indented text in a cell
borderLeft Styles the left border
borderRight Set the right border style
borderTop Sets the top border style
borderBottom Set the bottom border style
leftBorderColor Sets the left border color
rightBorderColor Set the right border color
topBorderColor Sets the top border color
bottomBorderColor Set the bottom border color
fillPatternType Setting the Fill Type
fillBackgroundColor Set the background color
fillForegroundColor Set the foreground
shrinkToFit Set automatic cell automatic size

@ExcelIgnore

Do not convert this field to Excel

@ExcelIgnoreUnannotated

Fields that are not annotated are not converted