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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





124887 Jul 6,2016 11:20 AM UTC Jul 8,2016 12:24 PM UTC ASP.NET Web Forms 3
Tags: Grid
Hrvoje Voda
Asked On July 6, 2016 11:20 AM UTC

IS there a way to use custom button to export data to excel?
I'm using this code but it doesn't work.

 Dim exp As New ExcelExport()

 exp.Export(grd.Model, grd.DataSource, "Materijali.xls", ExcelVersion.Excel2013)

When I decode grd.DataSource it's empty.

The same thing is for PDF export.

Jayaprakash Kamaraj [Syncfusion]
Replied On July 7, 2016 09:04 AM UTC

Hi Hrvoje, 

Thank you for contacting Syncfusion support. 

We have already discussed the same in following knowledge base document. 


Jayaprakash K. 

Hrvoje Voda
Replied On July 7, 2016 10:21 AM UTC

I tried that code, but I'm getting an error:
Object cannot be cast from DBNull to other types

Jayaprakash Kamaraj [Syncfusion]
Replied On July 8, 2016 12:24 PM UTC

Hi Hrvoje, 

We have created a sample with custom button to export grid data. Please refer to the below link.    

The Null exception issue may occur in any of the below scenarios.   
1.       If the DataSource of the Grid is DataTable   
2.       If the columns defined in grid is not present in the DataSource.   
Please refer to the following knowledge base document.


Also, we have provided “DataTable Support for exporting” from v14.1.0.41. So if you are using older version, please upgrade to the new version.   
If the issue has still not resolved, please provide the following details,  
1.       Is there any script error or exception thrown in your project? If so, attach a screenshot of your stack trace.      
2.       Share the video to show the issue. 
3.       Essential studio version details.  
4.       Browser details.   
5.       Issue replication procedure. 
6.       Did you export DataTable?   


Jayaprakash K. 


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