For spreedsheet.addSheet(content) the “content” parameter has to generated from a blob returned using webix.toExcel()
Is there a way in which i can achieve that using webix?
i.e spreadsheet.addSheet(contentFromBlob)…
Hello @Libinvarghese,
As a solution, you can get Excel data as an array using the toObject()
method of Webix Excel DataDriver
, apply the needed transformations to it and then, you will be able to add “content” to the sheet:
webix.DataDriver.excel.toObject(file).then(data=>{
var records = data.data;
var content = [];
for(var i=0; i<records.length; i++){
for(var r = 0; r<records[i].length; r++){
content.push([i+1,r+1,records[i][r]])
}
}
$$('sheet').addSheet({data:content})
})
Please take a look at the snippet:
https://snippet.webix.com/lyys1ne4