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

Export to Excel from web service

Thread ID:





127979 Dec 22,2016 03:39 PM UTC Dec 27,2016 06:34 AM UTC JavaScript 3
Tags: ejGrid
Asked On December 22, 2016 03:39 PM UTC

I want to export data from a grid to Excel using a web service.
I have the following code in aspx:

            $(function () {
                                    Locale: "es-ES",
                                    allowPaging: true,
                                    allowSorting: true,
                                    allowGrouping: true,
                                    groupSettings: { groupedColumns: ["empresa"] },
                                    toolbarSettings: { showToolbar: true, toolbarItems: [ej.Grid.ToolBarItems.ExcelExport] },
                                    columns: [
                                    { field: "empresa", headerText: "Empresa", width: 275, textAlign: ej.TextAlign.Left }
                                    toolbarClick: function (e) {
                                        this.exportGrid = this["export"];
                                        if (e.itemName == "exportación Excel") {
                                            e.cancel = true;


And in the file WebService.asmx I have this code:

    Public Sub ExcelExport(gridMode As String)
        Dim gridModel1 As String = HttpContext.Current.Request.Params("GridModel")
        Dim gridProperty As GridProperties = ConvertGridObject(gridModel)
        Dim exp As New ExcelExport()
        Dim result As IEnumerable(Of Order) = db.Orders.ToList()
        exp.Export(gridProperty, result, "Export.xlsx", ExcelVersion.Excel2010, False, False, "flat-saffron")
    End Sub

But it does not work.
How do I have to make it work for export?

The Grid is in a modal div, but I've tried a div with no modal and it does not work for me either.


Ragavee U S [Syncfusion]
Replied On December 23, 2016 12:02 PM UTC

Hi Juan, 

We have created a grid exporting sample with webservices, which can be downloaded from the below location.

Sample Linkhttp://www.syncfusion.com/downloads/support/directtrac/general/ze/JS_Export1434829110 

We would like you to ensure the below cases in your sample. 

1.       Please ensure the URL path mentioned within the export method of the ejGrid.  
2.       Also, in toolbarClick event of the Grid, you have checked the itemName as “exportación Excel”. Have you modified the the Toolbar item Name using the ej.Grid.Locale object? 
3.       Also, the locale property is incorrectly specified in your sample code as “Locale” instead of “locale”. 

Please try the above provided sample and if you still face any difficulties, please share following information. 

1.       Screenshot/Video demo of the issue that you are facing. 
2.       If script error/exception obtained while exporting, share the screenshot of the call stack of the exception. 
3.       If possible, please reproduce the issue in the above provided sample and share. 

Ragavee U S. 

Replied On December 23, 2016 03:17 PM UTC

Thank you. I will check it...


Ragavee U S [Syncfusion]
Replied On December 27, 2016 06:34 AM UTC

Hi Juan, 

Please check the given sample and let us know whether it works for you. 

Ragavee U S. 


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

or the page will be automatically redirected to 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