ami*_*efr 24

使用HSSFCellStyle,该类有一个名为setRotation(短旋转)的方法,它将旋转文本.您所做的只是将单元格样式应用于单元格:

HSSFCellStyle myStyle = workbook.createCellStyle();
myStyle.setRotation((short)90);

HSSFCell c = row.createCell(columnNumber);
c.setCellStyle(myStyle);
Run Code Online (Sandbox Code Playgroud)

  • setRotation中的int参数应该转换为short. (2认同)