import org.simpleods.*
// odsファイル作成
OdsFile of = new OdsFile("test7.ods")
// テーブル追加
tableName = ""
"シート1".each {
tableName += "&#" + Character.codePointAt(it, 0) + ";"
}
of.addTable(tableName)
tn = of.getTableNumber(tableName)
// 文字色を設定したスタイル
tsc = new TableStyle(TableStyle.STYLE_TABLECELL, "darkred")
tsc.setFontColor(Util.COLOR_DarkRed)
// セル設定
of.setCell(tn, "A1", "ABC", tsc)
of.setCell(tn, "A2", "日本語")
of.setCell(tn, "B1", 123)
of.save()
出力ファイルのイメージ

動作環境
groovy 1.7.2, JDK6 Update20, SimpleODS 0.4.4
関連項目
- SimpleODSまとめ
- SimpleODSのホームページ
http://simpleods.sourceforge.net/
0 件のコメント:
コメントを投稿