Exemplo n.º 1
0
        public FileResult Export(string criteria, string searchby)
        {
            var    data         = GetData(criteria, searchby);
            string exportedData = CustomerDataExporter.ExportToCSV(data);

            return(File(System.Text.Encoding.ASCII.GetBytes(exportedData), "application/Excel"));
        }
Exemplo n.º 2
0
        public ActionResult Export(string criteria, string searchBy)
        {
            CustomerDataExporter exporter = new CustomerDataExporter();
            var    customers  = GetCustomers(criteria, searchBy);
            string exportData = exporter.ExportToCsv(customers);

            return(File(System.Text.ASCIIEncoding.UTF8.GetBytes(exportData),
                        "application/Excel"));
        }