Last active
August 30, 2016 19:26
-
-
Save lokori/213c2415051a286f61a57b559496d45a to your computer and use it in GitHub Desktop.
set-or-create-cell! for docjure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn set-or-create-cell! | |
([sheet n val type] | |
(let [cellref (org.apache.poi.ss.util.CellReference. n) | |
r (.getRow cellref) | |
col (int (.getCol cellref)) | |
row (or (.getRow sheet r) (.createRow sheet r)) | |
cell (or (select-cell n sheet) (.createCell row col type))] | |
(set-cell! cell val))) | |
([sheet n val] | |
(set-or-create-cell! sheet n val org.apache.poi.ss.usermodel.Cell/CELL_TYPE_STRING))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment