I am using alasql to write the table data to a excel file. But I am not able to wrapText the content of the cell. There is a lot of space coming with value in the column and thus the value is not visible. The user has to manually open the excel and select all the data and click on wrapText.
var data1 = alasql('SELECT * FROM HTML("#dataToExport",{headers:true})');
var data3 = alasql('SELECT * FROM HTML("#dataToExport2", {headers:false})');
var opts = [{sheetid:'One', header:true, columns:{wrapText:true}}, {sheetid:'Two', header:true,rows:{wrapText:true}, columns:{wrapText:true}}];
var res = alasql('SELECT INTO XLSX("generatedExcel.xlsx",?) FROM ?',
[opts,[data1,data3]]);
But I am not able to wrap the text . The column size becomes very large and hence the size of the file become large.
I have found another code snippet to create excel sheet but I am not able to create multiple sheets in it .
$scope.tableToExcel = function(tableId,worksheetName){
var table=$(tableId),
ctx={worksheet:worksheetName,table:table.html()},
href=$scope.uri+$scope.base64($scope.format($scope.template,ctx));
return href;
}
But here I am unable to create multiple sheets.
Please let me know there is any wayout to create excel with multiple sheets with wrap text.