| 1. |
How Will You Rotate A Cell Content Using Apache Poi? |
|
Answer» XSSFCELLSTYLE CLASS can be used to rotate a cell. Following code snippet can be used to set the cell text ALIGNMENT to a SPECIFIED angle. //90 DEGREES XSSFCellStyle myStyle = workbook.createCellStyle(); myStyle.setRotation((short) 90); cell = row.createCell(5); cell.setCellValue("90D angle"); cell.setCellStyle(myStyle); XSSFCellStyle class can be used to rotate a cell. Following code snippet can be used to set the cell text alignment to a specified angle. //90 degrees XSSFCellStyle myStyle = workbook.createCellStyle(); myStyle.setRotation((short) 90); cell = row.createCell(5); cell.setCellValue("90D angle"); cell.setCellStyle(myStyle); |
|