Garudadwajan Garudadwajan - 1 year ago 148
Apache Configuration Question

how to rotate text in HSSFCell in apache POI?

How to rotate text which is there in HSSFCell class of Apache POI API?

Can you please provide some example code for the same?

Answer Source

Use HSSFCellStyle, that class has a method called setRotation(short rotation) which will rotate the text. All you do is apply the cell style to a cell:

HSSFCellStyle myStyle = workbook.createCellStyle();

HSSFCell c = row.createCell(columnNumber);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download