exp.Export(obj, DataSource, "Export.xlsx", ExcelVersion.Excel2010, false, false, "flat-saffron");
The stack trace is
[NullReferenceException: Riferimento a un oggetto non impostato su un'istanza di oggetto.]
Syncfusion.EJ.Export.GridExcelExport.ProcessRecordCell(Object row, Column column) +874
Syncfusion.EJ.Export.<>c__DisplayClasse.<ProcessRecordRow>b__d(Column column) +421
System.Collections.Generic.List`1.ForEach(Action`1 action) +11010045
Syncfusion.EJ.Export.GridExcelExport.ProcessRecordRow(Object row) +282
Syncfusion.EJ.Export.GridExcelExport.RenderRecord() +222
Syncfusion.EJ.Export.GridExcelExport.ProcessGridContents() +275
Syncfusion.EJ.Export.GridExcelExport.IterateElements() +539
Syncfusion.EJ.Export.GridExcelExport.ExportHandler() +50
Syncfusion.EJ.Export.GridExcelExport.ExecuteResult(GridProperties GridModel, IEnumerable dataSource) +553
Syncfusion.EJ.Export.GridExcelExport.ExportHelper(GridProperties gridModel, IEnumerable dataSource) +1000
Syncfusion.EJ.Export.GridExcelExport.Export(GridProperties gridModel, IEnumerable dataSource, Boolean multipleExport) +71
Syncfusion.EJ.Export.ExcelExport.Export(GridProperties gridmaodel, IEnumerable datasource, String excelname, ExcelVersion excelversion, Boolean isHideColumnIncude, Boolean isTemplateColumnIclude, String theme) +213
Thank you for your help.
Best regards,
Stefania Solari
1. Client side and server side full code example.
2. Are you performing any Grid operations like filtering\searching before exporting?
3. Essential studio version.
4. An issue reproducing sample if possible or sample hosted link or replicate the issue in the following sample.
Sample: http://www.syncfusion.com/downloads/support/forum/123454/ze/SyncfusionMvcApplication60862136599
Regards,
Jayaprakash K.
In the 13.4.0.63 version , we need to refer (Syncfusion.Pdf.Base, Syncfusion.XlsIO.Base and Syncfusion.DocIO.Base) corresponding version DLL’s and also ensure the .NET framework version. We have attached code example and screenshot of all the DLL reference for 4.5 framework.
Please refer to the following code example and screenshot.
Web.config
<assemblies> <add assembly="Syncfusion.EJ, Version=13.4450.0.63, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" /> <add assembly="Syncfusion.Compression.Base, Version=13.4450.0.63, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" /> <add assembly="Syncfusion.EJ.MVC, Version=13.4500.0.63, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" /> <add assembly="Syncfusion.Linq.Base, Version=13.4450.0.63, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" /> <add assembly="Syncfusion.XlsIO.Base, Version=13.4450.0.63, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" /> <add assembly="Syncfusion.Olap.Base, Version=13.4450.0.63, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" /> <add assembly="Syncfusion.Pdf.Base, Version=13.4450.0.63, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" /> <add assembly="Syncfusion.DocIO.Base, Version=13.4450.0.63, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" /> |
We were unable to reproduce the issue. But we suspect that the issue occurs when a column field is not defined in the Grid dataSource and obtained as null value, and hence throws a null exception.
Refer to the following knowledgebase document.
https://www.syncfusion.com/kb/3018/Null-Exception-while-exporting
If you still face the issue, share the following information to find the cause of the issue.
1. Client side and server side full code example.
2. Are you performing any Grid operations like filtering\searching before exporting?
3. Essential studio version.
4. An issue reproducing sample if possible or sample hosted link or replicate the issue in the following sample.
http://www.syncfusion.com/downloads/support/forum/123454/ze/SyncfusionMvcApplication60873316834
Regards,
Jayaprakash K.