Suggested solution for automatically calculating formulas #306

Closed
opened 2015-09-29 06:26:38 +00:00 by akaustel · 4 comments
akaustel commented 2015-09-29 06:26:38 +00:00 (Migrated from github.com)

I would like to add some formulas to my generated spreadsheet, like SUM(B4:B34), however it does not work as one would expect. When opened in a spreadsheet application the value is not calculated automatically, and is shown as empty or whatever was put into the v-value.

However, when looking into the problem of recalculating formulas I found and article on http://stackoverflow.com/questions/18355691/set-xlsx-to-recalculate-formulae-on-open, which suggests simply adding a tag <calcPr fullCalcOnLoad="1"/> would resolve the whole issue when opening the document in MS Office, OpenOffice, Google spreadsheet etc.

Anyone who understands the inner workings of js-xlsx might be able to test this. This might be an significantly easier way of solving the issue discussed #105, and maybe some other issues around formulas as well.

I would like to add some formulas to my generated spreadsheet, like `SUM(B4:B34)`, however it does not work as one would expect. When opened in a spreadsheet application the value is not calculated automatically, and is shown as empty or whatever was put into the `v`-value. However, when looking into the problem of recalculating formulas I found and article on http://stackoverflow.com/questions/18355691/set-xlsx-to-recalculate-formulae-on-open, which suggests simply adding a tag `<calcPr fullCalcOnLoad="1"/>` would resolve the whole issue when opening the document in MS Office, OpenOffice, Google spreadsheet etc. Anyone who understands the inner workings of js-xlsx might be able to test this. This might be an significantly easier way of solving the issue discussed #105, and maybe some other issues around formulas as well.
mdumouchel commented 2015-10-07 14:23:49 +00:00 (Migrated from github.com)

you might want to look at this issue
https://github.com/SheetJS/js-xlsx/issues/152#issuecomment-145090110

There is a fork that has added support for formulas.

you might want to look at this issue https://github.com/SheetJS/js-xlsx/issues/152#issuecomment-145090110 There is a fork that has added support for formulas.
akaustel commented 2015-10-07 15:25:43 +00:00 (Migrated from github.com)

Thanks @mdumouchel! I do, however, believe that #152 does not solve the issue at hand. My issue being that when I have generated a spreadsheet with formulas the resulting values are not calculated when opened in editor of choice. The formulas are present, but not calculated.

Thanks @mdumouchel! I do, however, believe that #152 does not solve the issue at hand. My issue being that when I have generated a spreadsheet with formulas the resulting values are not calculated when opened in editor of choice. The formulas are present, but not calculated.
mdumouchel commented 2015-10-08 15:20:21 +00:00 (Migrated from github.com)

Would you mind posting some sample code of the problem?

Would you mind posting some sample code of the problem?
SheetJSDev commented 2017-03-18 00:56:36 +00:00 (Migrated from github.com)

We updated the write test with an example

We updated the [write test](https://github.com/SheetJS/js-xlsx/blob/master/tests/write.js#L82-L93) with an example
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#306
No description provided.