NElliott
07/08/2021, 10:26 AMmichoel
07/08/2021, 12:11 PMNElliott
07/08/2021, 1:28 PMNElliott
07/08/2021, 3:53 PMlet wb = XLSX.utils.book_new();
wb.Props = {
Title: "SheetJS Tutorial",
Subject: "Test",
Author: "Neil Elliott",
CreatedDate: new Date()
};
wb.SheetNames.push("Test Sheet");
let ws = XLSX.utils.aoa_to_sheet(csvArray);
wb.Sheets["Test Sheet"] = ws;
I'm now struggling to see how I might create this as a file in the filecabinet.
Anyone advise please or have an example?dynamicl
07/08/2021, 4:53 PMdynamicl
07/08/2021, 4:53 PMdynamicl
07/08/2021, 4:54 PMNElliott
07/08/2021, 5:35 PMmichoel
07/08/2021, 11:27 PMconst contents = XLSX.write(workbook, { bookType: "xlsx", type: "base64" });
const fileObj = file.create({
name: 'report.xlsx',
fileType: file.Type.EXCEL,
contents,
});
fileObj.folder = scriptParameters.reportFolderId;
return fileObj.save();
NElliott
07/12/2021, 9:42 AMNElliott
07/12/2021, 10:06 AMconst contents = XLSX.write(workbook, { bookType: "xls", type: "base64" });
It works fine although I get a warning about protected mode blah blah blah which I'm hoping isn't an issue.
@michoel Thank you very much for your help.