Ejemplo n.º 1
0
        public ActionResult ExportTo(GridViewExportFormat format)
        {
            var setting = GetGridViewSetting();
            var data    = QuotesProvider.GetQuotes();

            if (format == GridViewExportFormat.Pdf)
            {
                return(GridViewExtension.ExportToPdf(setting, data));
            }

            if (format == GridViewExportFormat.Rtf)
            {
                return(GridViewExtension.ExportToRtf(setting, data));
            }

            if (format == GridViewExportFormat.Xls)
            {
                return(GridViewExtension.ExportToXls(setting, data, new XlsExportOptionsEx {
                    ExportType = DevExpress.Export.ExportType.WYSIWYG
                }));
            }

            if (format == GridViewExportFormat.Xlsx)
            {
                return(GridViewExtension.ExportToXlsx(setting, data, new XlsxExportOptionsEx {
                    ExportType = DevExpress.Export.ExportType.WYSIWYG
                }));
            }

            if (format == GridViewExportFormat.Csv)
            {
                return(GridViewExtension.ExportToCsv(setting, data, new CsvExportOptionsEx {
                    ExportType = DevExpress.Export.ExportType.WYSIWYG
                }));
            }

            return(Content(string.Empty));
        }
Ejemplo n.º 2
0
 public ActionResult Grid()
 {
     return(PartialView("Grid", QuotesProvider.GetQuotes()));
 }
Ejemplo n.º 3
0
 public ActionResult Index()
 {
     return(View(QuotesProvider.GetQuotes()));
 }