excel export error

Hello,
When attempting to export my ejGrid into an excel format I am getting this error:
"ej.webform.min.js:10 Uncaught TypeError: Cannot read property 'indexOf' of undefined
    at Object.ej.raiseWebFormsServerEvents (ej.webform.min.js:10)
    at Object.export (ej.web.all.min.js:10)
    at Object._toolbarOperation (ej.web.all.min.js:10)
    at Object._toolBarClick (ej.web.all.min.js:10)
    at Object._trigger (ej.web.all.min.js:10)
    at Object._onItemClick (ej.web.all.min.js:10)
    at HTMLLIElement.<anonymous> (ej.web.all.min.js:10)
    at HTMLLIElement.dispatch (jquery-3.1.1.min.js:3)
    at HTMLLIElement.q.handle (jquery-3.1.1.min.js:3)"


here is my javascript code. You will notice some code commented out as I was attempting to try different forms of exporting that I had found on the threads, but each of them are giving me the same error. 

 $("#GridContainer").ejGrid({
                        dataSource: ej.DataManager(list),
                        //dataSource: ej.DataManager({ url: "http://js.syncfusion.com/ExportingServices/Northwnd.svc/Orders/" }),
                        allowScrolling: true,
                        columns: columns,
                        allowSorting: true,
                        height: '70vh',
                        allowReordering: true,
                        allowSearching: true,
                        allowResizing: true,
                        toolbarSettings: {
                            showToolbar: true,
                            toolbarItems: [
                                "search", ej.Grid.ToolBarItems.PrintGrid, ej.Grid.ToolBarItems.ExcelExport,
                                ej.Grid.ToolBarItems.PdfExport
                            ]
                        },
                        showSummary: true,
                        allowGrouping: true,
                        allowResizeToFit: true,
                        groupSettings: { groupedColumns: [] },
                        exportToExcelAction: spaceManagementAreaUrl + "Grid/ExcelExport",
                        summaryRows: [
                            {
                                title: "Total",

                                showTotalSummary: true,
                                showCaptionSummary: true,
                                summaryColumns: [
                                    {
                                        summaryType: ej.Grid.SummaryType.Sum,
                                        displayColumn: displayColumn,
                                        dataMember: displayColumn,
                                        format: '{0:N2}'


                                    }
                                ]
                            }
                        ],
                     /*   toolbarClick: function(args) {
                            if (args.itemName === "Excel Export") {
                                alert('hello');
                                args.cancel = true;
                                alert('part 2');
                                this.export(spaceManagementAreaUrl+ "Grid/ExcelExport"); // Excel Export method.
                            }
                        }*/


                    });




On the server side (Asp.net Controller) I have copied what i saw on the site. 
[System.Web.Http.ActionName("ExcelExport")]
        [AcceptVerbs("POST")]
        public void ExcelExport()
        {
            string gridModel = System.Web.HttpContext.Current.Request.Params["GridModel"];
            GridProperties gridProperty = ConvertGridObject(gridModel);
            ExcelExport exp = new ExcelExport();
            IEnumerable<object> result = _polys;
            exp.Export(gridProperty, result, "Export.xlsx", ExcelVersion.Excel2010, false, false, "flat-                                                                                                                                                                                                saffron");
        }




could you help me in understanding what could be happening and what I can do to fix this. Thank you!

3 Replies

TS Thavasianand Sankaranarayanan Syncfusion Team February 5, 2018 12:21 PM UTC

Hi Nicholas, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we are able to reproduce the reported issue “script error thrown while exporting to excel” from our end. We suspect that you have use JS as a front end and ASP.NET as backend. So, we suggest you to remove the ej.webform.min.js file reference from your project. This is the root cause of the issue. 

Regards, 
Thavasianand S. 



BE Becky February 5, 2018 01:18 PM UTC

Thank you. That solved the problem. 

Appreciate the help.


TS Thavasianand Sankaranarayanan Syncfusion Team February 6, 2018 08:46 AM UTC

Hi Nicholas, 
 
We are happy that the problem has been solved at your end. 
 
Please get back to us if you need any further assistance.  
 
Regards, 
Thavasianand S. 


Loader.
Up arrow icon