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.
Unfortunately, activation email could not send to your email. Please try again.

Grid Export Generates script error

Thread ID:

Created:

Updated:

Platform:

Replies:

123768 Apr 19,2016 09:48 AM Apr 20,2016 02:31 AM ASP.NET Web Forms 1
loading
Tags: Grid
Johnny Washington
Asked On April 19, 2016 09:48 AM

When clicking the grid export button the following error occures...
OnServerExcelExporting="ResultsEJGrid_ServerExcelExporting" AllowPaging="True">

 <ej:Grid ID="ResultsEJGrid" runat="server" AllowSorting="True"
          OnServerExcelExporting="ResultsEJGrid_ServerExcelExporting" AllowPaging="True">
          <DataManager URL="/api/Results/GetResultsPaged" Offline="false" Adaptor="UrlAdaptor"></DataManager>
          <GroupSettings EnableDropAreaAutoSizing="false" EnableDropAreaAnimation="true" ShowUngroupButton="true" CaptionFormat="#template"></GroupSettings>
          <ToolbarSettings ShowToolbar="true" ToolbarItems="excelExport,wordExport,pdfExport"></ToolbarSettings>
          <Columns>
            <ej:Column TemplateID="#caseLink" HeaderText="Id#" AllowEditing="False" TextAlign="Center" Width="6em" Field="ID_NB" />
          </Columns>
        </ej:Grid>
      </ContentTemplate>

Unhandled exception at line 10, column 9414 in http://localhost:3575/ScriptResource.axd?d=TAuAUGEcWnJSAEmaomvf4-8rVSng5fdQ6wyu7Qzs_gKymWMpfd-wP2g705SQlad65zDvPy0zic72UHKCXeZRq1fAT5noNFYaEihpOSFTBMKPdFZaQFIGG7IdW-2-QbnmDmV_O_CYjDPJCfUcmV9UM4o362angLoPV3cxaAWaPHZ3r7nzcBl6SJz7ER0E5lS70&t=ffffffffbdcbe025

0x800a138f - JavaScript runtime error: Unable to get property 'indexOf' of undefined or null reference

Balaji Marimuthu [Syncfusion]
Replied On April 20, 2016 02:31 AM

Hi Johnny,

Thanks for contacting Syncfusion support.

We have checked the reported issue by using the provided code snippets, but we were unable to reproduce the reported issue. So could you please try the attached sample and share following information.

Sample: Sample-F123768

1.     In provided code snippet, the Grid was rendered inside the content template. So we suspect that you are rendering Grid inside update panel. If you’re rendering Grid inside update panel and perform the export operation please ensure the following knowledge base document and code example.

                https://www.syncfusion.com/kb/5442

               


<asp:UpdatePanel runat="server" ID="UpdatePanel1">

            <ContentTemplate>

                <ej:Grid ID="FlatGrid" runat="server" AllowSorting="True"  OnServerExcelExporting="FlatGrid_ServerExcelExporting" AllowPaging="True">


                  . . .


                </ej:Grid>

            </ContentTemplate>

            <Triggers>

                <asp:PostBackTrigger ControlID="FlatGrid" />

            </Triggers>

        </asp:UpdatePanel>


2.     Ensure the dataSource is specified in the server exporting method, because while binding the remote data we need to specify the dataSource.


protected void FlatGrid_ServerExcelExporting(object sender, Syncfusion.JavaScript.Web.GridEventArgs e)

        {

            ExcelExport exp = new ExcelExport();

            FlatGrid.DataSource = new NorthwndDataContext().Orders.Take(50).ToList();

            exp.Export(FlatGrid.Model, (IEnumerable)FlatGrid.DataSource, "Export.xlsx", ExcelVersion.Excel2010, true, true, "flat-lime");


        }


3.     Essential studio and browser version details.

4.     Scenario to reproduce the issue and full code snippets of Grid default.aspx and code behind page.

5.      Share sample if possible or modify the attached sample as issue reproducible.


Regards,
Balaji Marimuthu


CONFIRMATION

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.

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.

;