Apache OpenOffice (AOO) Bugzilla – Issue 34625
Export spreadsheet as javascript
Last modified: 2013-08-07 15:12:27 UTC
Today it is possible to have Calc export the spreadsheet as an HTML-file. However, the HTML-file is just a static file, whereas the spreadsheet is dynamic and changes if you change some of the input fields. It would be nice if it was possible to export the spreadsheet as javascript so it was possible to change the non-formula fields in a browser and have the result presented after a javascript calculation. It would be useful even if a lot of functionality could not be exported (e.g. graphs).
Hi Bettina, sounds interesting but may be very difficult to implement. Frank
I have have a few ideas concerning implementation. We will need a javascript function for each of the functions in Calc. Some will probably not be easy to write in javascript and those can be left out - the javascript export is usable even if some functions are not exportable. The recalculation order should be determined in advance. So it will not be needed to make a topological sorting in javascript or checks for self-referencing formulas (eg: A1=B2+A1). A lot of other functionality can probably be determined in advance: Instead of a general sum function you could generate specific functions that return the value (e.g. sum_from_b12_to_b17() { return b12()+b13()+b14()+b15()+b16()+b17 () } An input validation mechanism can be copied from Jwig's PowerForms
To grep the issues easier via "requirements" I put the issues currently lying on my owner to the owner "requirements".
There's a commercial plugin to Excel that does this. Someone with extensive JavaScript experience should be able to handle what would largely be formulas tied to a form. My JavaScript is confined to understanding what another person has written and can modify it to suit my needs.