banner
RustyNail

RustyNail

coder. 【blog】https://rustynail.me 【nostr】wss://ts.relays.world/ wss://relays.world/nostr

Poi export Excel line breaks are being eaten up.

When exporting Excel using easy poi, \n is being eaten up.

Solution

Workbook workbook = ExcelExportUtil.exportExcel(params, map);
            CellStyle cs = workbook.createCellStyle();
            cs.setWrapText(true);
            for (int i = workbook.getSheetAt(0).getFirstRowNum() + 2; i <= workbook.getSheetAt(0).getLastRowNum(); i++) {
                Row row = workbook.getSheetAt(0).getRow(i);
                row.getCell(3).setCellStyle(cs);
            }
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.