rikkertkoppes / json2xls

canonically transform json to an excel document
278 stars 85 forks source link

Unable to perform basic formatting on excel. #12

Closed tukaram-patil closed 8 years ago

tukaram-patil commented 8 years ago

Not able to set basic formatting's like.

  1. Freeze first rows or columns.
  2. Make values of row bold.
  3. Wrap-up the test according to heading of column.
rikkertkoppes commented 8 years ago

json2xls uses https://github.com/functionscope/Node-Excel-Export to create the excel sheet. Any functions available there can be passed along as a second parameter to json2xls: var xls = json2xls(json, options); res.xls('data.xlsx', jsonArr, options);

The following options are supported:

- style: a styles xml file, see <https://github.com/functionscope/Node-Excel-Export>
- fields: either an array or map containing field configuration:
    - array: a list of names of fields to be exported, in that order
    - object: a map of names of fields to be exported and the types of those fields. Supported types are 'number','string','bool'

There is a lot you can do in the styles.xml file, for example setting the font. Not sure about freezing and wrapping though.

A lot of info on styles can be found here: http://officeopenxml.com/SSstyles.php