We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Excel export with sheet name

Thread ID:

Created:

Updated:

Platform:

Replies:

143594 Mar 28,2019 09:45 AM UTC Jan 6,2021 12:12 PM UTC Angular - EJ 2 3
loading
Tags: Grid
Neo
Asked On March 28, 2019 09:45 AM UTC

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.

Thavasianand Sankaranarayanan [Syncfusion]
Replied On 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, 

                                https://ej2.syncfusion.com/angular/documentation/api/grid/excelExportProperties/ 

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, 

                                https://ej2.syncfusion.com/angular/documentation/api/grid/excelQueryCellInfoEventArgs/ 
                                https://ej2.syncfusion.com/angular/documentation/api/grid/excelStyle/#borders  

Please get back to us for further assistance. 
 
Regards, 
Thavasianand S. 


lorryl
Replied On January 5, 2021 10:11 AM UTC

Hi,

How to change the "sheet1" name if using multi grid export ?


Balaji Sekar [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon