I am using Kendo grid for MVC 4.0. I have the latest dll 2015.1.318.440. I turn on jszip.js. I copied and pasted the code from the example:
.ToolBar(tools => tools.Excel())
.Excel(excel => excel.FileName("Enrollments.xlsx"))
He does not do anything. The button changes color and what it is. I do not get any errors when trying. He just does nothing. I do not use a proxy server. I run this in the latest version of Chrome.
Grid
@(Html.Kendo().Grid<Trawick.Agents.Models.EnrollmentPolicy>()
.Name("grid")
.ToolBar(tools => tools.Excel())
.Excel(excel => excel
.FileName("Enrollments.xlsx")
.Filterable(true)
.ProxyURL(Url.Action("Excel_Export_Save", "Enrollments"))
)
.Columns(columns =>
{
columns.Bound(p => p.enrollment_date)
})
.Pageable()
.Groupable()
.Sortable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Enrollments_Read", "Enrollments")))
)
Controller
[HttpPost]
public ActionResult Excel_Export_Save(string contentType, string base64, string fileName)
{
var fileContents = Convert.FromBase64String(base64);
return File(fileContents, contentType, fileName);
}
public ActionResult Enrollments_Read([DataSourceRequest]DataSourceRequest request, int? id)
{
string sql = "SELECT * FROM EnrollmentPolicy ";
sql += SearchParams.SetSearch(this);
return Json(GetEnrollments(sql).ToDataSourceResult(request));
}
Batch files including jszip
bundles.Add(new ScriptBundle("~/js/kendo")
.Include("~/Scripts/jszip.js")
.Include("~/Scripts/kendo.all.min.js")
.Include("~/Scripts/kendo.aspnetmvc.min.js"));
source
share