Sunday, 28 May 2017

Using Google Sheets to create a .xslx file from sql data

I am trying to create a .xlsx file with data I retrieve from mysql to a node.js server that serves an angularjs project, but after hours of trying to find something via npm or google I almost gave up!

The two main problems I have are:

  • My data is in hebrew (i.e. rtl styling + different characters).
  • The Excel file that I export needs to be styled in a specific way, and it is a pain trying to style an excel file grammatically.

And then I had an idea!

What if I could create a google sheet doc in my google drive as a template including the styling, and then when the user clicks to create a new doc, I would just duplicate this template, and change the values to the new data.

But just trying to understand the google api is a headache on its on, apparently, there are 3! different api's: Drive, Sheets and auth.

So my question is as follows.

  • Is my idea valid? does anyone think it could work?
  • Where would I start, is there some guide or npm that would help?

Please don't comment to look in the docs, I am having a hard time to understand where to start from there.



via Rabbi Shuki

No comments:

Post a Comment