Jimbo99999
asked on
Export JSON data to Excel
Good Day Experts!
I am working on a project for my landscaping business and need a little bit of direction. It utilizes node/express/sequelize/myS QL. The user input saving to the database is working great. I have JSON data displaying based on user selection of search criteria. I have the JSON data exporting to a CSV file. I would like to format the heading and data rows so they look presentable. I am guessing I have to switch to creating an actual excel workbook.
I have been searching the net for how to achieve output to an excel workbook. Unfortunately, I have not had any success just trying to create an excel workbook. Could you point me the direction ?
Thanks,
jimbo99999
I am working on a project for my landscaping business and need a little bit of direction. It utilizes node/express/sequelize/myS
I have been searching the net for how to achieve output to an excel workbook. Unfortunately, I have not had any success just trying to create an excel workbook. Could you point me the direction ?
Thanks,
jimbo99999
hmm, I would use XML with an XSLT to HTML instead of CSV.
ASKER
Hello
Thanks for the replies. I have been trying all 3 but not having any luck. I am going to circle back to the exceljs and try that again.
Thanks for the replies. I have been trying all 3 but not having any luck. I am going to circle back to the exceljs and try that again.
ASKER
Well, I was able to get it working kind of.
If I have all of the spreadsheet generating code in my server.js file it works great. If I have 1) at the top of the server.js file and 2) behind the button click in my view.js file I get the error --> "Uncaught ReferenceError: Excel is not defined"
If I have 1) and 2) behind the button in my view.js file I get the error --> "Uncaught ReferenceError: require is not defined"
1) var Excel = require('exceljs');
2) var workbook = new Excel.Workbook();
Can you offer insight in what I am missing?
Thanks,
Ed
If I have all of the spreadsheet generating code in my server.js file it works great. If I have 1) at the top of the server.js file and 2) behind the button click in my view.js file I get the error --> "Uncaught ReferenceError: Excel is not defined"
If I have 1) and 2) behind the button in my view.js file I get the error --> "Uncaught ReferenceError: require is not defined"
1) var Excel = require('exceljs');
2) var workbook = new Excel.Workbook();
Can you offer insight in what I am missing?
Thanks,
Ed
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have been unable to get any of the suggestions to work. I am still giving it the old boot camp try.
ASKER
Thank you for the help,
jimbo99999
jimbo99999
I'm not sure since I need some data but you can try this converter as a start. It might be able to convert your data to look more presentable.
Reference: http://www.convertcsv.com/json-to-csv.htm