protected async Task DownloadExcel() { ShowTitleContextMenu = false; byte[] bytes = await GridConfig.DownloadExcel(await GridConfig.GetListAsync(GridSearch)); string fileName = string.IsNullOrWhiteSpace(GridConfig.ExcelFileName) ? $"{GridConfig.GridTitle}{DateTime.Now.Date.ToShortDateString().Replace("/", "-")}.xlsx" : GridConfig.ExcelFileName; JsHelper jsHelper = new JsHelper(); ErrorMessage = await jsHelper.DownloadExcelAsync(jSRuntime, bytes, fileName); }
protected async Task DownloadSample() { ShowTitleContextMenu = false; ShowUploadSubMenu = false; byte[] bytes = await GridConfig.DownloadExcel(new List <object>()); string fileName = "Sample_" + (string.IsNullOrWhiteSpace(GridConfig.ExcelFileName) ? $"{GridConfig.GridTitle}{DateTime.Now.Date.ToShortDateString().Replace("/", "-")}.xlsx" : GridConfig.ExcelFileName); JsHelper jsHelper = new JsHelper(); ErrorMessage = await jsHelper.DownloadExcelAsync(jSRuntime, bytes, fileName); }