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

Error exporting grid to excel

I was trying to export the Grid to excel that bind to datatable but i'm getting the error, "Thread was being aborted".

Private Sub SqReadBonusComm()
            GV.gvSql = "SELECT * " &
                        "FROM dbo.Bonus_Summary (NOLOCK) " &
                        "WHERE MEMBER_ID = '" & USR.ID & "' " &
                        "AND Type <> 'Payout'"

            GV.CreateDataTable(DB, GV.gvSql, cnnMain)

            Session(MsFg1SesBonusComm) = GV.gvDataTable.DefaultView.ToTable

            gBonusComm.DataSource = Session(MsFg1SesBonusComm)
        Catch ex As Exception
            SystemErrorsAlert("SqReadBonusComm", ex.Message, Me.Page)
        End Try
    End Sub

Protected Sub FlatGrid_ServerExcelExporting(sender As Object, e As Syncfusion.JavaScript.Web.GridEventArgs)
            Dim exp As New ExcelExport()
            Dim dt As DataTable = DirectCast(Session(MsFg1SesBonusComm), DataTable)

            exp.Export(gBonusComm.Model, dt, "Export.xlsx", ExcelVersion.Excel2010, True, True, "flat-lime")
        Catch ex As Exception
            SystemErrorsAlert("FlatGrid_ServerExcelExporting", ex.Message, Me.Page)
        End Try
    End Sub

1 Reply

JK Jayaprakash Kamaraj Syncfusion Team February 21, 2017 11:31 AM UTC

Hi Danferd, 

Thank you for contacting Syncfusion support. 

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

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.   

Please download the latest version from the below link.  

Please follow the below steps. 

1)      Download and install the Essential Studio v15.1.0.33 .  
2)      Replace the Syncfusion scripts, CSS and DLL’s in your project from the following location. 

            Scripts and CSS: C:\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\JavaScript\assets 
            Dlls: C:\Program Files (x86)\Syncfusion\Essential Studio\ XX.X.X.XX \Assemblies 

Here XX.X.X.XX denotes the product version( 

And also after upgrading please ensure to clear the browser cache to avoid accidental reference of the old scripts/CSS. 

If the issue has still not resolved, please provide the following details,  

1.       Attach a screenshot of your stack trace.      
2.       Share the video to show the issue. 
3.       Essential studio version and Browser details.   
4.       Issue replication procedure. 


Jayaprakash K. 

Live Chat Icon For mobile
Up arrow icon