Skip to content

Commit

Permalink
generate multiple excel sheets
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilpenugonda committed Oct 21, 2023
1 parent 7da3906 commit 61407d0
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,14 @@ onFileUploaded(event: any) {
}

generateExcelSheets(){

const wb = XLSX.utils.book_new();

let wb = XLSX.utils.book_new();
this.groupedData.forEach((data: any) => {
wb = XLSX.utils.book_new();
let sheetName = this.targetColumns.map((column: any) => data[0][column.name]).join("-");
const ws = XLSX.utils.json_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, sheetName);
XLSX.writeFile(wb, sheetName+ ".xlsx");
});
XLSX.writeFile(wb, 'SheetJS.xlsx');
}
onSortChange(event: any) {
const value = event.value;
Expand Down

0 comments on commit 61407d0

Please sign in to comment.