public void ExportToExcel(string GridModel) { ExcelExport exp = new ExcelExport(); GridProperties obj = ConvertGridObject(GridModel); exp.Export(obj, currentData, "Export.xlsx", ExcelVersion.Excel2010, false, false, "flat-saffron"); } . . . private GridProperties ConvertGridObject(string gridProperty) { . . . } |
function btnSearchClick(sender) { var f1 = document.getElementById("DatePick").value; var f2 = document.getElementById("DatePick2").value; console.log(f1 + ' ' + f2); $.ajax({ url: "/Grid/DataSourceVentas2", type: "POST", data: { date1: f1, date2: f2 }, success: function (result) { var formatData = ej.parseJSON(result); var obj = $("#FlatGrid").ejGrid("instance"); obj.dataSource(result); obj.dataSource(formatData); } }); } |
.ClientSideEvents(evt => evt.ToolbarClick("OnToolbarClick")) ) <script type="text/javascript"> function OnToolbarClick(args) { if (args.itemName.indexOf("Export") > -1) {//if no selectedRecords, currenviewdata will be exported this.model["currentData"] = JSON.stringify(this.model.dataSource); } } |
Thx a lot, this solve my day