import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.*;
workbook = WorkbookFactory.create(new FileInputStream("test1.xlsx"))
// セルの値を回転
sheet = workbook.getSheetAt(0)
cs = workbook.createCellStyle()
cs.setRotation((short)90)
sheet.getRow(0).getCell(1).setCellStyle(cs)
workbook.write(new FileOutputStream("test33.xlsx"))
サンプルExcelブック(test1.xlsx)

出力Excel(test33.xlsx)

動作環境
groovy 1.7.0, JDK6 Update18, Apache POI 3.6
0 件のコメント:
コメントを投稿