Referring to this Javascript JSON to Excel file download, I tried and successfully convert from JSON to XLSX. However the result is viewed in horizontal, the question is how to make it vertical? I just have only 1 long object data not multiple object. That why I prefer the result is in vertical for better view.
Horizontal View
Vertical View
Code:
var data = [{
"Name": "Michael",
"Place": "Home",
}
]
filename='personal.xlsx';
var ws = XLSX.utils.json_to_sheet(data);
var wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, "People");
XLSX.writeFile(wb,filename);