mjul / docjure

Read and write Office documents from Clojure
MIT License
619 stars 129 forks source link

Make `dk.ative.docjure.spreadsheet/create-date-format` public #107

Open pablokleene opened 1 year ago

pablokleene commented 1 year ago

Hello,

Im trying to write the code to stream a jdbc-next result, of typeIReduceInit, row by row during the reduction into a Sheet.

Got this error The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx Workbook. Looking into this repo, I've found this PR that fixes the problem by memoizing the date creation, but only if Im using add-rows!.

(binding [xls/create-date-format (memoize xls/create-date-format)]
  (reduce (fn [_ row]
            (xls/add-row! sheet row))
          nil
          result))

I tried to do the same wrapping in my code but create-date-format is a private var and I can reference it from the outside. I achieved what I wanted copying the code to my namespace and overriding dk.ative.docjure.spreadsheet/set-cell with (defmethod dk.ative.docjure.spreadsheet/set-cell! Date ... but I was wondering if this one could be made public

thanks a lot!