-
-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retrieve shared formulas #67
Conversation
Retrieve shared formulas according to ECMA-376, Part 1, 18.3.1.40 f (Formula)
@Y-- apologies for the belated reply -- busy day :/ I just added some test files. Take a look at https://github.com/SheetJS/test_files/raw/master/formulae_test_simple.xlsx -- something looks off:
|
- basic style theme parsing, option .cellStyles (h/t @eladxxx) - more XLSB writing stubs - correct resolution of .xml/.bin files - sheet_to_json improvements from js-xls o opts.header = 1 for array of arrays o opts.header = 'A' for spreadsheet column labels o custom opts.header array for custom labels o opts.range = n starts from row n o opts.range = range restricts writer to work within the specified range - Makefile adapted to work with cygwin on windows
@SheetJSDev thanks for taking a look at my PR. |
It looks like we'd need a bona-fide Excel formula parser to do this right, ideally something that converts to the parsed things format that XLS and XLSB use. The grammar for the tokens is laid out in MS-XLSB 2.5.97.88 (http://msdn.microsoft.com/en-us/library/dd946774.aspx) and MS-XLS 2.5.198.104 (http://msdn.microsoft.com/en-us/library/dd908135.aspx). I can look into this later |
Ok great. Should we put the master formula in a other field in the meantime ? |
@Y-- For now, it might make sense to add an array For example, in the example, the first shared formula is:
In this case, we'd need to store the actual formula |
- eliminated functional constructs in hot functions - format try-catch block extracted into new function - cpexcel codepage updated to 1.2.0 - more efficient (and correct) clean implementation of RGB/HSL/tint algorithms - xlsx binary --all option enables every extra formatting and saving option - column widths parsed and saved (requires cellStyles:true)
- jscs linting to check for trailing comma issues (h/t @altkatz) - IE: phased out lazy string indexing in favor of charCodeAt - XLSX: replaced certain operations in hot functions with faster alternatives - updated SSF to 0.7.1 - improved coverage in tests
The original push showed up as failed, pushing again
Retrieve shared formulas according to ECMA-376, Part 1, 18.3.1.40 f (Formula)
- updated codepage to 1.3.1 (h/t @VolodymyrL)
- parsexmltag and other hot functions now better optimized for v8 - monomorphic functions (different types -> different funcs) - more efficient decode_range implementation when source is trusted - regular expressions cached and simplified without breaking correctness - more efficient utf8 techniques when available - XLSX: large functions broken down into sub-functions (e.g. `parse_ws_xml`) - XLSB: avoid unnecessary binds - XLSB: assume no exotic codepage exists (no one else tries to write XLSB) - demo exposes rABS / worker / transferable options - more tests - jszip updated to 2.3.0 - SSF updated to 0.8.1 - codepage updated to 1.3.1
- browser shim updated (h/t @wintersm for discovering this) - smart tag ignores (h/t @lostinplace) - sheet_to_row_object_array bugfix (fixes SheetJS#80, h/t @ChrisBurkeBSD) - README improved - baltic and vietnamese codepages: updated codepage to 1.3.4 - iOS Numbers can handle inline strings -> disabling SST by default - avoid Buffer accessors (see nodejs/node-v0.x-archive#7809) - caching certain hot regexes
Retrieve shared formulas according to ECMA-376, Part 1, 18.3.1.40 f (Formula)
Conflicts: xlsx.js
What ended up happening with this PR? |
Hi, bumping this. I've made a private fork of XLSX JS and have created a true blue formula parser and resolver... and I'm just now running into this little issue... the shared formula thing is a big issue and I am wondering if anyone has any documentation about the rules that govern shared formulas and how I can make inferences from the data in the XML and generate the appropriate formulas. I'm pretty much ready to build this, I just need more data to pursue it. Doing the corporate dance to try and get my work on parsing/resolving into your repo, not easy, but I think you guys would be quite happy with what I've created. If I could make a request of the group, one of the most immediate barriers is the shared attribute is currently not even being parsed and added to the dictionary. If that could be done then I could do a merge and start cranking... |
This was addressed in 0.8.4. XLSX XLSB XLS and SpreadsheetML now parse shared and array formulae. In XLSX, the raw shared formula is stored in the upper left cell along with a shared id The current iteration uses a very simple regex which only fail on some special cases that can be refined with a more precise regular expression. @jasconius I originally thought a proper parser was needed but in retrospect a fine tuned regular expression can work (Excel itself prohibits defined names that potentially collide with a valid cell address). |
Implement 18.3.1.40