mjul / docjure

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

Expose quotePrefixed style attribute in `create-cell-style!` #103

Closed orestis closed 1 year ago

orestis commented 1 year ago

I noticed that when outputting Excel, you shouldn't really prefix the content with a single quote e.g. '=1+2 (this was a valid strategy when outputting CSV).

Since POI/docjure will actually set the value as a string, and not as a formula, Excel will display it correctly. But, if you try to edit some text that begins with e.g. - then Excel will complain and ask you to prefix manually.

You can avoid that, by setting the quotePrefixed attribute in the cell style. It would be nice to expose that as a keyword in the create-cell-style! function.

mjul commented 1 year ago

Thanks for the input. It sounds like you are well informed about this. I would welcome if you submit a PR with the relevant changes.

orestis commented 1 year ago

Thanks, PR is ready, with an extra assertion in the existing test.