How to view existing excel file within application

I want to show existing excel file lying on server to client browser within the application probably in Modal window. 


Can anybody help me on this...?


Thanks in adv


1 Reply

JS Janakiraman Sakthivel Syncfusion Team August 20, 2021 03:23 AM UTC

Hi Gautam Sheth,  
  
Thank you for contacting Syncfusion support. 
  
We have checked your reported requirement and it can be achievable in our spreadsheet. For your convenience, we have prepared the sample that render the spreadsheet with existing excel file inside the dialog component as like as below. 
  
  
  
@Html.EJS().Button("alertBtn").CssClass("dlgbtn").Content("Modal Spreadsheet").Render() 
  
@Html.EJS().Dialog("alert_dialog").Visible(false).Header("Spreadsheet Component inside Dialog").ContentTemplate(@<div>@Html.EJS().Spreadsheet("spreadsheet").OpenUrl("Home/Open").SaveUrl("Home/Save").Created("onCreated").Height("600").Render()</div>).ShowCloseIcon(true).Width("800px").Height("800px").MinHeight("600px").Render() 
  
  
function onCreated() { 
var ssObj = ej.base.getComponent(document.getElementById('spreadsheet'), 'spreadsheet'); 
fetch("http://localhost:54467/Files/" + "MedReviewGuidelines.xlsx").then(response => { 
                                                response.blob().then(fileBlob => { 
                                                                var file = new File([fileBlob], "Sample.xlsx"); // to open the blob file 
                                                                ssObj.open({ file: file }); 
                                                }); 
                                }); 
                } 
  
  
Could you please check the above link and get back to us, if you need any further assistance on this. 
  
Regards,
Janakiraman S. 


Loader.
Up arrow icon