コード例 #1
0
        public virtual ActionResult ExportToExcel()
        {
            LogI("ExportToExcel");

            var filters = new CustomerFilterViewModel();

            string filename = "CustomerReport_" + Time.GetAppNowTime().ToString("ddMMyyyyHHmmss") + ".xls";
            var    output   = CustomerViewModel.ExportToExcel(LogService,
                                                              Time,
                                                              Db,
                                                              filters);

            return(File(output.ToArray(),           //The binary data of the XLS file
                        "application/vnd.ms-excel", //MIME type of Excel files
                        filename));                 //Suggested file name in the "Save as" dialog which will be displayed to the end user
        }