Skip to content

Instantly share code, notes, and snippets.

@sambatriste
Last active August 29, 2015 14:22
Show Gist options
  • Save sambatriste/b2f4b5a3c6c7bb35ee78 to your computer and use it in GitHub Desktop.
Save sambatriste/b2f4b5a3c6c7bb35ee78 to your computer and use it in GitHub Desktop.
axebomberの再現試験
(ns axebomber.wrap_and_rowspan
(:require [clojure.java.io :as io])
(:use [axebomber usermodel]
[axebomber.renderer excel]
[axebomber.style :only [create-style]]
[midje.sweet]))
(fact "折り返しとrowspanが混ざるとrowspanが足りない?"
(let [wb (create-workbook) sheet (to-grid (.createSheet wb "otameshi"))]
(render sheet {:x 0 :y 0}
[:table
[:tr
[:td {:style "background-color: grey25" :data-width 15} "親項目"]
[:td {:style "background-color: grey25" :data-width 21} "子項目1"]
[:td {:style "background-color: grey25" :data-width 15} "子項目2"] ;; ここの幅を広くするか
]
[:tr
[:td {:rowspan 2} "この下の罫線がへんなかんじ↓"]
[:td "ほげほげ"]
[:td "ふがふが"]
]
[:tr
[:td "もげもげ"]
[:td "ここが折り返されるとrowspanとずれるのではないだろうか?"] ;; これを短くして折り返さないようにすると期待通りの動きになります。
]
]
)
(with-open [out (io/output-stream "target/wrap_and_rowspan.xlsx")]
(.write wb out))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment