Fork me on GitHub
#clojure-europe
<
2020-04-28
>
synthomat07:04:55

good morning

plexus10:04:26

afternoon!

otfrom10:04:26

I approve of this flouting of UGT @plexus 🙂

otfrom10:04:07

I'm going to be making more pretty pictures w/ cljplot today

otfrom10:04:37

it is pretty good for creating lots of static png files to put into reports and excel sheets

otfrom10:04:53

I'm quite happy with the code I hacked to get the pngs into excel 🙂

otfrom10:04:29

(fn [[sheet-name img]]
    (try
     (let [ ;; int pictureIdx = wb.addPicture(bytes, Workbook.PICTURE_TYPE_JPEG);
           pic-idx (.addPicture wb img Workbook/PICTURE_TYPE_PNG)
           sheet (xl/select-sheet sheet-name wb)
           helper (.getCreationHelper wb)
           drawing (.createDrawingPatriarch sheet)
           anchor (.createClientAnchor helper)
           _ (.setCol1 anchor 14)
           _ (.setRow1 anchor 2)
           ;; Picture pict = drawing.createPicture(anchor, pictureIdx);
           ;; pict.resize();
           pict (.createPicture drawing anchor pic-idx)]
       (.resize pict))
     (catch Exception e
            (throw (ex-info (str "Failed to create sheet. " sheet-name) {:sheet-name sheet-name} e)))))

👍 4
otfrom10:04:03

the only really annoying thing is the 32 char limit on tab names in excel