Exemplo n.º 1
0
        /// <summary>
        /// The method creats XLSX file with all products, save it on server and returns it to client
        /// </summary>
        /// <returns>The XLSX (MS Exel) file with all products</returns>
        public FileResult ExportToExel()
        {
            TransferData export = new TransferData();

            string filePath = Server.MapPath("~/Content/documents/Catalog.xlsx");
            string fileType = "xlsx";
            string fileName = "Catalog.xlsx";

            export.ExportToXLSX(productService.GetAllElements(), filePath);

            return(File(filePath, fileType, fileName));
        }