2009-07-14 44 views

回答

20

使用HSSFCellStyle,该类有一个名为setRotation(短旋转)的方法,它将旋转文本。你要做的就是应用单元格样式为单元:

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

HSSFCell c = row.createCell(columnNumber); 
c.setCellStyle(myStyle); 
+0

非常感谢......我能够旋转单元格文本... – Garudadwajan 2009-07-14 13:52:41

0
CellStyle cssVertical = wb.createCellStyle(); 
cssVertical.setFont(f); 
cssVertical.setRotation((short)90);