SyncFusion ejSpreadSheet - postback on saving

0
0

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.

http://somehost/postback.wx/464a1ec8-47fc-79ff-a665-d122b58da8da/ewAiAGkAZAAiADoAIgBpAGQAXwAyADEAIgB9AA==?format=xlsx

What am I doing wrong.

D

  • You must to post comments
0
0

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

  • You must to post comments
0
0

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

 

  • You must to post comments
0
0
  • Dino Novak
    Online sample works Also If I run locally Wisej.Web.Ext.Syncfusion.Test it also works but your sample Wisej.SyncfusionSpreadsheetSample is also triggering postback and not working Can you try and save from Wisej.SyncfusionSpreadsheetSample on your machine? D
  • Luca (ITG)
    Where is Wisej.SyncfusionSpreadsheetSample?
  • Dino Novak
    Provided from your side in this article https://wisej.com/support/question/syncfusion-controls
  • Dino Novak
    Is there any way to get spreaddsheet content and export is by not using SaveAs option? I know there is this.ejSpreadsheet1.Instance.XLExport.export(“Excel”, “Report”); but this Report is supposed to be file name, so again creating postback error. can I get content in xls format to memory stream somehow?
  • You must to post comments
0
0

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?

  • You must to post comments
0
0

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.

  • Levie (ITG)
    You can find the full source code for the Wisej Syncfusion extensions here: https://github.com/iceteagroup/Wisej-Ext-Syncfusion. My build is the same as this GitHub version. You may have found an old bug that was fixed in a more recent version. Can you try building the extension from the GitHub source and let me know if that solves the issue? What version of Chrome are you using? Best, Levie
  • Dino Novak
    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.
  • You must to post comments
0
0

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

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.