Search code examples
node.jsextjsextjs4

Options for Parsing Excel Files in ExtJS


I'm having a very hard time accomplishing my main goal: extracting data from an xlsx excel file

I'm running ExtJS + node.js, and I see two options:

  1. Use this XLSX.js framework to convert the base64 string into js object-representations of xlsx worksheets for me to use. Problem is, I have no idea how to get a base64 string from an xlsx file..
  2. Upload the xlsx file to the server, do the conversions there using node-xlsx, the send the object-representations back ala json. Having lots of difficulties here since ExtJS doesn't use real AJAX for file uploads so I don't know how to send the results back..

Has anyone had experience with this or could advise a solution? Having lots of trouble..


Solution

  • Number two is going to be the better option IMO. You can take a look at the FileUploadField control - there is a good example on submitting the Form that will upload the file to the server: http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.field.File

    From there you can parse and return the json.