- Home
- Forum
- Angular - EJ 2
- Excel export with sheet name
Excel export with sheet name
Hi all,
Does anybody knows how to export excel document with changing sheet name? I looked on 'ExcelExportProperties' class. Couldn't find any property for that. And I also want add black borders in every cell. Please help to solve those.
Thank you.
SIGN IN To post a reply.
3 Replies
TS
Thavasianand Sankaranarayanan
Syncfusion Team
March 29, 2019 05:22 AM UTC
Hi Neo,
Greetings from Syncfusion.
Query #1: Does anybody knows how to export excel document with changing sheet name?
We have analyzed your query and we suggest to refer to the below documentation to change the name of the exported excel sheet,
Documentation: https://ej2.syncfusion.com/angular/documentation/grid/excel-exporting/?no-cache=1#file-name-for-exported-document
Query #2: I also want add black borders in every cell
We suggest to refer to the below documentation to customize the exported excel cells,
Documentation: https://ej2.syncfusion.com/angular/documentation/grid/excel-exporting/?no-cache=1#conditional-cell-formatting
Please get back to us for further assistance.
Regards,
Thavasianand S.
LO
lorryl
January 5, 2021 10:11 AM UTC
Hi,
How to change the "sheet1" name if using multi grid export ?
BS
Balaji Sekar
Syncfusion Team
January 6, 2021 12:12 PM UTC
Hi lorryl,
Based on your query we suspect that you want to change the sheet name in exporting excel file. To achieve your requirement we suggest you to use the below code example
|
toolbarClick(args) {
if (args.item.text == "Excel Export") {
const appendExcelExportProperties = {
multipleExport: { type: "NewSheet" }
};
const firstGridExport = this.fgrid.excelExport(
appendExcelExportProperties,
true
);
firstGridExport.then(workbook => {
workbook.worksheets[0].name = "WS1"; // Changed the sheet name
const secondGridExport = this.sgrid.excelExport(
appendExcelExportProperties,
true,
workbook
);
secondGridExport.then(wb => {
wb.worksheets[1].name = "WS2"; // Changed the sheet name
const book = new Workbook(wb, "xlsx");
book.save("Export.xlsx");
});
});
}
} |
Regards,
Balaji Sekar
SIGN IN To post a reply.
- 3 Replies
- 4 Participants
-
NE Neo
- Mar 28, 2019 09:45 AM UTC
- Jan 6, 2021 12:12 PM UTC