Record java uses EasyExcel to perform line break operations in cells

1. First, replace \n  or \r\n with String.valueOf((char)10) where a line break is required  . Sometimes it can be used without replacement

2. After the first step is completed, the exported content may still not be able to wrap, you need to double-click the cell to wrap,

Add annotations to exported java entity classes


@ContentStyle(

horizontalAlignment = HorizontalAlignmentEnum.CENTER,

verticalAlignment = VerticalAlignmentEnum.CENTER,

wrapped = BooleanEnum.TRUE)

Notes:

        HorizontalAlignmentEnum.CENTER: Centered horizontally

        VerticalAlignmentEnum.CENTER: vertical center

        wrapped = BooleanEnum.TRUE: causes wrapping to succeed

For other annotation information, please refer to: Detailed introduction to the common annotations of EasyExcel_A Ren_'s blog-CSDN blog_easyexcel java annotation 

Guess you like

Origin blog.csdn.net/cccsssrrr/article/details/128122940