advisr-io / excel4node

Node module to allow for easy Excel file creation
MIT License
124 stars 18 forks source link

Use more standard representation of boolean values in cells #62

Closed pineapplemachine closed 1 year ago

pineapplemachine commented 1 year ago

See https://bugs.documentfoundation.org/show_bug.cgi?id=155046

Unfortunately the OOXML ECMA-376 spec does not ever seem to explicitly mention what is expected for a <v> cell value element within a <c> cell element where t="b" indicates a boolean value type. But it seems that excel4node's writing the text "true" and "false" instead of the text "0" and "1" within <v> elements representing boolean values is uncommon behavior.

With this change, boolean cells now display as expected in LibreOffice Calc and Google Sheets, where previously they did not.

I verified on my system that npm run test and node sample.js && ./validate.sh Excel.xlsx both run successfully after building.

This is an improved implementation of the same fix as in #59.

jrohland commented 1 year ago

This looks good. I added additional boolean cells to the sample.js to verify the output: https://github.com/advisr-io/excel4node/commit/45725710bc88e8f70c738cdbf519a7a442908f82

Comparing the output from main to this pull request in google docs shows the correct values now being rendered. Left is current version, right is this pull request. image

LibreOffice Calc is also now rendering boolean true values correctly: image