You need to sign in to do that
Don't have an account?
VSK98
How to create multiple worksheets within a single excel sheet in lightning
Hello All,
I am able to download the excel sheet but it contains only one worksheet and I need to add one more worksheet to the existing excel sheet.
Snippet code:
Adv thanks,
VSK98
I am able to download the excel sheet but it contains only one worksheet and I need to add one more worksheet to the existing excel sheet.
Snippet code:
var uri = 'data:application/vnd.ms-excel;base64,'; var template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'; var base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }; var format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }; var htmls = "YOUR HTML AS TABLE"; var ctx = { worksheet : 'Worksheet', table : htmls } var link = document.createElement("a"); link.download = "export.xls"; link.href = uri + base64(format(template, ctx)); link.target = '_self'; link.click()
Adv thanks,
VSK98