We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

NullReferenceException when exporting to Excel

Thread ID:





148638 Oct 28,2019 10:58 PM UTC Nov 7,2019 10:58 AM UTC ASP.NET Web Forms 5
Tags: Grid
Asked On October 28, 2019 10:58 PM UTC

I have a page with a Grid control to list some data (version 16.3460.0.21).
The grid is working as expected: pagination, sorting, column choose, search (Excel type) but I've found a situation that throws an excepcion and I have no clue of what's happening.
There are about 700 rows in the table and have a pagination of 12 rows per page. Excel and Pdf exporting are working as well... except under a unique situation:
If I put a simple "L" in the Make column search box, the list of searchable items is updated with rows which make contains L:

Curiously, it includes the items with null or whitespace (I don't understand it, but doesn't matter for the moment) and the list is updated with the search parameters:

Ok. Now if I try to export my list to Excel (or Pdf), a NullReferenceException is thrown when calling to the IWorkbook.Export method.
The exception does not bring too much information about what's happening

If I open again the search dropdown and uncheck the whitespace option, the filter succeed again and the export
 works withou exception.
The Make column is nullable but this shouldn't affect to the results.

How can I know what's exactly producing the exception and/or how to fix it??
Thanks in advance

Dinesh Rajendiran [Syncfusion]
Replied On October 29, 2019 03:01 PM UTC

Hi Toni, 
Thanks for contacting syncfusion support. 
The reported exception(i.e. NullReferenceException) is already a known issue in version and it has been fixed in our latest version  
Would you like to upgrade to the latest version or would you need a patch in your version for this issue ? 
Dinesh Rajendiran 

Toni Moreno
Replied On October 29, 2019 03:12 PM UTC

I prefer, at this moment, a patch so a newer version could affect to the rest of the application.
Later I will try a new version and see if everything goes right.

Dinesh Rajendiran [Syncfusion]
Replied On October 31, 2019 12:52 PM UTC

Hi Toni, 

Thanks for contacting syncfusion support. 

We have generated patch for the issue “NullReferenceException while exporting to excel” in version 

Please replace the custom script file “ej.web.all.min.js”  available in the attachment in your application to reflect the changes. 
If you have further queries please get back to us. 
Dinesh Rajendiran 

Replied On November 6, 2019 12:52 PM UTC

I applied the suggested change to my app but the issue remains the same.

Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On November 7, 2019 10:58 AM UTC

Hi Toni, 

Before proceeding this, we need some more additional details to find the cause of the issue. Please share us the following details. 
  1. Complete StackTrace of the issue or Exception.
  2.  Stringified model of the Grid on server side while on Exporting as like below screenshot and copy it into clipboard.
  3. Complete Grid code example(both in client and server side)
  4. Please ensure to clear the browser cache to avoid accidental reference of the old scripts/CSS. There might be chance of referring old scripts.
  5. If possible share us the simple reproducing sample after the patch has been applied.
Farveen sulthana T 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon