ASP.Net MVC syncfusion Grid Excel Export Not Working

  • Thread starter Thread starter Hrishi K
  • Start date Start date
H

Hrishi K

Guest
In my asp.Net MVC application , syncfusion grid excel export not working. while clicking on the Excel Export toolbar not will happen.it is not go to the function i have written in controller.please see the below code and help me.

@(Html.EJ().Grid<MEDC_MASTER1>("Grid")
.Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.dataSource).UpdateURL("UpdateDC").InsertURL("InlineInsert").RemoveURL("InlineDelete").Adaptor(AdaptorType.RemoteSaveAdaptor))
.EditSettings(edit =>
{
edit.AllowEditing().EditMode(EditMode.Normal);
})
.ToolbarSettings(toolbar =>
{
toolbar.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.Edit);
items.AddTool(ToolBarItems.Update);
items.AddTool(ToolBarItems.Cancel);
items.AddTool(ToolBarItems.ExcelExport);
});
})
.Mappers(map => map.ExportToExcelAction("MultipleExportToExcel2"))
.AllowSorting()
.AllowPaging(false)
.AllowMultipleExporting()
.AllowScrolling()
.AllowFiltering()
.AllowSelection()
.SelectionType(SelectionType.Multiple)
.AllowResizing()

.Columns(col =>
{
col.HeaderTemplateID("#headerTemplate").Template(true).TemplateID("#checkboxTemplate").TextAlign(TextAlign.Center).Width(25).Add();
col.Field(d => d.ID).IsPrimaryKey(true).Visible(false).Width(25).Add();
col.Field(d => d.Batch_Name).Add();
col.Field(d => d.account_number).Width(150).AllowEditing(false).Add();
col.Field(d => d.consumer_name).Width(150).AllowEditing(false).Add();
col.Field(d => d.consumer_mobile).Width(150).AllowEditing(false).Add();
col.Field(d => d.area_code).Width(100).AllowEditing(false).Add();
col.Field(d => d.meter_number).Width(150).AllowEditing(false).Add();
col.Field(d => d.DC_Status).Width(75).EditType(EditingType.Dropdown).DataSource((IEnumerable<object>)ViewBag.datasource2).Add();
col.Field(d => d.DC_remark).Width(75).Add();
col.Field(d => d.DC_date).Width(150).EditType(EditingType.DateTimePicker).Add();
col.Field(d => d.DC_staff).Width(150).EditType(EditingType.Dropdown).DataSource((IEnumerable<object>)ViewBag.datasource3).Add();
col.Field(d => d.DC_lattitude).AllowEditing(false).Width(150).Add();
col.Field(d => d.DC_longitude).AllowEditing(false).Width(150).Add();
col.Field(d => d.DC_current_reading).AllowEditing(false).Width(150).Add();
col.Field(d => d.DC_consumer_type).AllowEditing(false).Width(150).Add();
col.Field(d => d.DC_disconnection_type).AllowEditing(false).Width(150).Add();
col.Field(d => d.DC_reason).AllowEditing(false).Width(150).Add();
col.Field(d => d.DC_other_reason).AllowEditing(false).Width(150).Add();
col.Field(d => d.DC_app_version).AllowEditing(false).Width(100).Add();
col.Field(d => d.DC_pole_approved).AllowEditing(false).Width(100).Add();

})
.ClientSideEvents(evt => evt.ToolbarClick("OnToolbarClick").DataBound("ondatabound").ActionComplete("complete"))
)


Function used in Controller

public void MultipleExportToExcel2(string[] GridModel)
{
///////////
//////////
}

Getting Error

1515943.png

Continue reading...
 
Back
Top