natergj / excel4node

Node module to allow for easy Excel file creation
MIT License
1.38k stars 215 forks source link

Add default cell style definition #353

Closed artiz closed 6 months ago

artiz commented 2 years ago

Hi, I have found that XLSX file generated by your library is opened with following warning in openpyxl:

.local/lib/python3.8/site-packages/openpyxl/styles/stylesheet.py:226: UserWarning: Workbook contains no default style, apply openpyxl's default                                                       
warn("Workbook contains no default style, apply openpyxl's default")   

I checked empty Excel file file structure and found that it has cellStyleXfs/cellStyles elements with default "Normal" style. So I have added same definitions to workbook builder. With these changes tha warning is elminated.

Also I have fixed logic bug with contentTypesAdded used for Content-Types duplication check

arthurblake-AngelOak commented 2 years ago

Unfortunately It looks like this excellent project might be abandoned by the author... I hope @natergj is alive and well and on to better things. I think our best bet going forward is this fork: https://www.npmjs.com/package/@advisr/excel4node I asked @jrohland nicely to merge this PR and it's done! See https://github.com/advisr-io/excel4node/commit/77945722660769b94caf3e9507b5a936dc559f9d