Hi, I keep getting this NullReferenceException when trying to save spreadsheet as stream. here is the exception stackTrace: à Syncfusion.EJ.Export.SheetExport.InitializeSheet() à Syncfusion.EJ.Export.SheetExport.ProcessSheet(WorkbookProperties sheetModel, DataContainer sheetData) à Syncfusion.EJ.Export.SheetExport.ExportAsBinary(WorkbookProperties sheetModel, DataContainer sheetData, ExportFormat type, ExcelVersion excelVersion) à Syncfusion.EJ.Export.Spreadsheet.Save(String sheetModel, String sheetData, ExportFormat type, ExcelVersion excelVersion) à PL_ACALIS.Controllers.ImportExportController.ExportToCsv(String sheetModel, String sheetData) dans c:\...\ImportExportController.cs:ligne 547 à lambda_method(Closure , ControllerBase , Object ) à System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object parameters) à System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) à System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) à System.Web.Mvc.Async.AsyncControllerActionInvoker.ActionInvocation.InvokeSynchronousActionMethod() à System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) à System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) à System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() à System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) à System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) à System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() à System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() Note that sheetModel and sheetData are not empty. any help please. thanks.
SISilambarasan I Syncfusion Team November 16, 2016 10:42 AM UTC
Thank you for using Syncfusion products.
We have checked the reported issues and we are unable to reproduce it in our end.We have prepared a sample to demonstrate this and the same can be downloaded from the following sample link.Also, we would like to know the following details,
1. In which way do you bind the data source into Spreadsheet by either setting JSON data to “rangeSettings” or by importing the excel with import URL property or any other binding? If possible, please share the imported data or excel file that you want to export as stream – CSV type.
2. Could you please let us know if you customize the sheetData and sheetModel values from export action method or from ‘saveAsJSON()’ client-side method?
3. Please share the code snippet if you did any customization after rendered Spreadsheet.
4. Could you please provide us more information about ‘error occurring when paste data in Spreadsheet’ such as data copied within Spreadsheet or from external source, steps to replicate this issue from our side.
Could you please replicate your issues in the above sample and send back to us with the above information so that we could able to sort out the cause of this issue and provide you a better solution quickly? The information provided would be great help for us to proceed further.
ADaymen drineNovember 16, 2016 12:51 PM UTC
Hi Silambarasan, Thank you for replaying in such short notice.
First we are using syncfusion dll's version 13.4400.53 (as updated in the sample updated and attached to this post).
My spreadsheet do not contain any data at initialization => the datasource is empty.
I did not customise the values of sheetDataor sheetModel.
The only customization i did to the spreadsheet was removing the add_sheet button when the document is ready.
About "paste data in Spreadsheet". The data are copied from external Excel File. Pasting data copied within Spreadsheet work fine.
SISilambarasan I Syncfusion Team November 17, 2016 11:03 AM UTC
Thanks for your update.
Query #1 “NullReferenceException occur when saving the Spreadsheet as Stream”
We have checked the attached sample project and found that the Scripts (ej.web.all.min.js) and CSS (ej.widgets.all.min.css) are referred from v126.96.36.199 which have cross referenced with the v188.8.131.52 assemblies (EJ, EJ.Export, Linq.Base, XlsIO.Base).This is the cause of the issue “NullReferenceException” while saving the Spreadsheet as Stream. So, we would like to suggest you to refer the Scripts, CSS & assemblies from same product version in your project. Could you please ensure this and get back to us with issue reproducible sample if the issue still persists?
Please refer the below modified sample in v184.108.40.206.
Note: Script & CSS references version should be same as the assembly version.
Query #2 “js error occuring when i paste same thing on the spreadsheet:”
We have checked the reported issue by copied the data from our sample Excels and paste it in Spreadsheet but we are unable to reproduce it in our end.Could you please share us your Excel file and provide us more information regarding this issue such as copied range in that Excel file and steps to replicate this issue? So, that we could able to sort out the cause of this issue and provide you a better solution quickly. The information provided would be great help for us to proceed further.
ADaymen drineNovember 17, 2016 11:58 AM UTC
After updating the js and css files, the problem was solved. Thank you for your halp.
SISilambarasan I Syncfusion Team November 18, 2016 05:57 AM UTC
Thanks for your update.We are happy to hear that your issue has been resolved.
Kindly get back to us if you need any further assistance.
ADaymen drineNovember 24, 2016 10:41 AM UTC
I would like to ask you about ExportToExcel Url. Can i add some parameters to the URL, checkbox for example? and how to do so?
SISilambarasan I Syncfusion Team November 25, 2016 09:17 AM UTC
Thanks for your update.
We have checked your requirement “To add additional parameters on ExcelExport” and we would like to let you know that, currently we don’t have event for adding parameters on exporting. However, we considered this as an improvement and this will be available in our Essential Studio 2016 Volume 4 Service Pack 1 release.
ADaymen drineNovember 25, 2016 10:04 AM UTC
Thank you for your help.
SISilambarasan I Syncfusion Team November 28, 2016 04:50 AM UTC
Thanks for the update.
Please let us know if you need any further assistance on this. We will be happy to help you.