-
-
Save TheShubhamVsnv/9dc3c72a35568a4f18aaf3161bc1f4f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exportExcelData() { | |
// Create a new Excel workbook | |
const workbook = new ExcelJS.Workbook(); | |
// ... (Sheet creation logic for 'Index', 'Sheet 1', 'Sheet 2', 'Sheet 3') | |
// Write the workbook to a buffer and initiate download | |
workbook.xlsx.writeBuffer().then(buffer => { | |
var link = document.createElement("a"); | |
link.href = 'data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,' + buffer.toString('base64'); | |
link.download = 'FullProfileDetails.xls'; | |
document.body.appendChild(link); | |
link.click(); | |
document.body.removeChild(link); | |
}); | |
// Show success message | |
const evt = new ShowToastEvent({ | |
title: 'Download Successful', | |
message: 'Multiple Sheet Data downloaded successfully', | |
variant: 'success', | |
mode: 'dismissable' | |
}); | |
this.dispatchEvent(evt); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment