1. 首先在需要強制換行的單元格里使用poi的樣式,並且把樣式設定為自動換行
- HSSFCellStyle cellStyle=workbook.createCellStyle();
- cellStyle.setWrapText(true);
- cell.setCellStyle(cellStyle);
2. 其次是在需要強制換行的單元格,使用/就可以實再強制換行
- HSSFCell cell = row.createCell((short)0);
- cell.setCellStyle(cellStyle);
- cell.setCellValue(new HSSFRichTextString("hello/r/n world!"));
