public ActionResult ExportTo(string exportCommand)
        {
            var settings = CreatePivotGridSettings();
            var data     = NwindModel.GetInvoices();

            switch (exportCommand)
            {
            case "XlsWysiwyg":
                return(PivotGridExtension.ExportToXls(settings, data,
                                                      new DevExpress.Web.ASPxPivotGrid.PivotXlsExportOptions()
                {
                    ExportType = DevExpress.Export.ExportType.WYSIWYG
                }));

            case "XlsDataAware":
                return(PivotGridExtension.ExportToXls(settings, data));

            case "XlsxWysiwyg":
                return(PivotGridExtension.ExportToXlsx(settings, data,
                                                       new DevExpress.Web.ASPxPivotGrid.PivotXlsxExportOptions()
                {
                    ExportType = DevExpress.Export.ExportType.WYSIWYG
                }));

            case "XlsxDataAware":
                return(PivotGridExtension.ExportToXlsx(settings, data));

            case "Csv":
                return(PivotGridExtension.ExportToCsv(settings, data));

            case "Pdf":
                return(PivotGridExtension.ExportToPdf(settings, data));

            case "Rtf":
                return(PivotGridExtension.ExportToRtf(settings, data));
            }
            return(new EmptyResult());
        }
Esempio n. 2
0
 public static System.Data.DataTable GetSalesPersonData()
 {
     return(NwindModel.GetInvoices());
 }
 public ActionResult PivotGridPartial()
 {
     ViewBag.PivotSettings = CreatePivotGridSettings();
     return(PartialView("_PivotGridPartial", NwindModel.GetInvoices()));
 }