- Home
- Forum
- ASP.NET Web Forms
- NullReferenceException when exporting to Excel
NullReferenceException when exporting to Excel
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
SIGN IN To post a reply.
5 Replies
DR
Dinesh Rajendiran
Syncfusion Team
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 16.3.0.21 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 16.3.0.21 for this issue ?
Regards,
Dinesh Rajendiran
TM
Toni Moreno
October 29, 2019 03:12 PM UTC
Hello.
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.
Thanks
DR
Dinesh Rajendiran
Syncfusion Team
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 16.3.0.21.
Patch link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/nullreferenceexception_patch-1887119355
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.
Regards,
Dinesh Rajendiran
TO
Toni
November 6, 2019 12:52 PM UTC
Hello.
I applied the suggested change to my app but the issue remains the same.
Regards
FS
Farveen Sulthana Thameeztheen Basha
Syncfusion Team
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.
- Complete StackTrace of the issue or Exception.
- Stringified model of the Grid on server side while on Exporting as like below screenshot and copy it into clipboard.
- Complete Grid code example(both in client and server side)
- Please ensure to clear the browser cache to avoid accidental reference of the old scripts/CSS. There might be chance of referring old scripts.
- If possible share us the simple reproducing sample after the patch has been applied.
Regards,
Farveen sulthana T
SIGN IN To post a reply.
- 5 Replies
- 4 Participants
-
TO Toni
- Oct 28, 2019 10:58 PM UTC
- Nov 7, 2019 10:58 AM UTC