Thanks Madhan,
Yeah, I see how your making your version work, but it's not a real world of how one would actually go about using this..
I currently have a very large Api - that is in .Net 4.6.1 .. so I've hacked it together to use .NetCore.MVC for this SyncFusion... I use ApiController so don't have an MVC Controller, but I managed to do a work around for that.
I also don't have a Files folder on my server... the Excel uploads go into an ExcelUploads folder, but again, I'm trying to do a work around.
I'm also not saving the file onto the Server upon Opening the Excel document, as you can imagine.. I only want to save it when they save it.
This Excel function once saved on the server, the user then moves to another Step in the Process, which based upon Step 1 - a Form (defines the type of Excel document to be uploaded), Step 2 - the Excel upload, then Step 3 commits steps 1 & 2 to the server, grabs the Excel document (in the API and deletes it) sends into a backend WCF service which extracts the data from the Excel. Based upon the type of data in the Excel file, it then Saves data into different tables and deletes the Excel document and finally uploads it on to Microsoft OneDrive via their API.
And this whole thing is nested within Components, in a tabbed page full of other various bits of business information.
So it's pretty complex.
So... I can't do this, because it suggests saving the Excel document onto the Server when the document is opened on the Client.
createdExcel() {
var request = new XMLHttpRequest();
request.responseType = "blob";
request.onload = () => {
var file = new File([request.response], "Sample.xlsx");
this.spreadsheetObj.open({ file: file });
}
request.open("GET", this._dataService.baseUrl + '/tables/syncfusion/open/Files/' + "Sample.xlsx");
request.send();
}
In addition, this url "http://localhost:55367/Files/" + "Sample.xlsx" will never exist... it's part of a large Api that I can't split because I need to use the Excel in a different process