I am currently using json2xls to export my queried data in json format into a xlsx file like so:
var xls = tool.json2xls(data, {order:["NAME", "OWNER_EMAIL", "GROUP", "BRAND", "DOC_CENTER_URL", "LIBRARYURL", "TOTAL_VIEWS"],
fieldMap: {NAME: "Name", OWNER_EMAIL: "Owner Email", GROUP: "Group", BRAND: "Brand", DOC_CENTER_URL: "Doc Center URL",
LIBRARYURL: "Library URL", TOTAL_VIEWS: "Total Views"}});
I am already using the option field fieldMap to edit column names which works well but I want to be able to edit the widths of each column so that when the xlsx is opened it will be formatted well. In the json2xls docs it says that the avaiable options are:
- 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'