I added Wisej-Ext-Syncfusion reference,
ejSpreadSheet is loading, I can display xls file from server generated one.
I also added
private void ejSpreadsheet1_WebRequest(object sender, WebRequestEventArgs e)
that fires when file is opened / saved.
But when i am trying to save file, on
Spreadsheet.Save(sheetModel, sheetData, fileName, ExportFormat.XLSX);
I am getting postback error.
What am I doing wrong.
D
Hi,
I have added the postback processing, private void ejSpreadsheet1_WebRequest(object sender, WebRequestEventArgs e) so it is not reasson for error.
I was using syncfusion.ej from nuget (which then downloaded a whole lot of other packages as dependencies), now I found in wisej.web.ext.syncfusion.test there is a Libs folder, when I added reference to there libraries postback is working ok
Hi Dino,
I tried the original sample that simply shows the postback url. It is correct. The reason is that what you want to do with the callback has to be decided by your app. Look at the Component/ejSpreadsheet in Github. You have to attach to WebRequest and then decide what to do with the data. Which also answers your last question since the data is available on the server.
This is in the example.
private void ejSpreadsheet1_WebRequest(object sender, WebRequestEventArgs e) { // load the file? if (e.Request.Files.Count == 1) { e.Response.Write(LoadFile(e.Request.Files[0].InputStream)); } else { SaveFile( e.Request.Form["fileName"], e.Request["format"], e.Request["sheetModel"], e.Request["sheetData"]); } } private void SaveFile(string fileName, string fileFormat, string sheetModel, string sheetData) { switch (fileFormat) { case "xls": Spreadsheet.Save(sheetModel, sheetData, fileName, ExportFormat.XLS); break; case "xlsx": Spreadsheet.Save(sheetModel, sheetData, fileName, ExportFormat.XLSX); break; case "pdf": Spreadsheet.Save(sheetModel, sheetData, fileName, ExportFormat.PDF); break; case "csv": Spreadsheet.Save(sheetModel, sheetData, fileName, ExportFormat.CSV); break; } }
Refer to the Syncfusion docs for the Spreadsheet API.
HTH
Checked out latest wisej-ext-syncfusion from suggested address,
build it, added dll to references.
Tried your sample with:
– Firefox 85.0 Win
– Chrome 88.0.4324.104 (Official Build) (64-bit) Win
Same postback error occurs, can you check from your side?
HI,
I am trying with your sample, same postback is happening.
The only thing that could be problematic is build of wisej.ext.syncfusion.dll, can you provide your version of dll.
I am attaching screen recording to show behavior.
Hi Dino,
Did you try the sample application we provided? Does that work for you?
Could you please attach a sample of your application and a screenshot of the error?
Best,
Levie
Please login first to submit.