public async Task <ActionResult> ExportExcel(string filterRules = "", string sort = "Id", string order = "asc") { var fileName = "menuitems_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx"; var stream = await menuItemService.ExportExcelAsync(filterRules, sort, order); return(File(stream, "application/vnd.ms-excel", fileName)); }