How to hide File->New Button and why Evalution warnning sheet appears by default

How to hide File->New Button and why Evalution warnning sheet appears by default

Attachment: Untitled_c95b55da.rar

2 Replies 1 reply marked as answer

GK Gayathri KarunaiAnandam Syncfusion Team April 2, 2021 01:00 PM UTC

Hi Apurba, 
  
We have checked your reported query. 

Query 1:  hide File->New Button 
 
We can enable/disable the menu items by using enableFileMenuItems method in fileMenuBeforeOpen event as demonstrated in the below code snippet. 


<div class="control-section"> 
  <ejs-spreadsheet 
    #default 
    [openUrl]="openUrl" 
    [saveUrl]="saveUrl" 
    (created)="created()" 
    (fileMenuBeforeOpen)="hideNew($event)" 
  > 



hideNew(args) { 
    this.spreadsheetObj.enableFileMenuItems(["New"], false); 
  } 



For your reference, we have prepared a sample based on this scenario. Please check the below link. 



Query 2: Warning  

We have checked your reported requirement and we would like to let you know that we have used our ej2 services for demo purpose only. So, we suggest you that use your local service for open/save functionality. For local service you need ASP.NET Core project as a backend for Open/Save functionality in your angular application. 

Create ASP.NET Core project and generate the license based on the below KB link. 
 
 
And include the licensed key in your project startup file as like in the below documentation link. 
 
 
The list of below dependencies is required to use the EJ2 Spreadsheet in your application.  
 
1. Syncfusion.EJ2  
 
2. Syncfusion.EJ2.Spreadsheet 
 
3. Syncfusion.Compression.Base 
 
4. Syncfusion.XlsIO.Base 
 
For more details, please refer the below links. 
 
 
For more details regarding the Open/Save server functionality. Please refer the below links. 
 

Open Method: 
 
public IActionResult Open(IFormCollection openRequest) 
{ 
    OpenRequest open = new OpenRequest(); 
    open.File = openRequest.Files[0]; 
    return Content(Workbook.Open(open)); 
} 

Save Method: 

public void Save(SaveSettings saveSettings) 
{ 
    Workbook.Save(saveSettings); 
} 

Refer the above Open/Save controller method link in openUrl and saveUrl respectively in spreadsheet as like as below. 
 

<ejs-spreadsheet openUrl=”Your Hosted link /controller name/open action method” saveUrl=” Your Hosted link /controller name/save method 
> </ejs-spreadsheet> 

For example link would be: "http://localhost:49371/Spreadsheet/Save" 
 
Could you please check the above details and get back to us, if you need any further assistance on this. 


Regards, 
Gayathri K 


Marked as answer

AS Apurba Saha April 2, 2021 01:24 PM UTC

Thanks for your quick response.

Loader.
Up arrow icon