Exemplo n.º 1
0
        public ActionResult Export()
        {
            var            model              = Product.GetProducts();
            IBasePrintable gridViewPrintable  = GridViewExtension.CreatePrintableObject(ViewsHelper.CreateGridViewSettings(), model);
            IBasePrintable pivotGridPrintable = PivotGridExtension.CreatePrintableObject(ViewsHelper.CreatePivotGridSettings(), model);

            XtraReport report = new SampleReport(gridViewPrintable, pivotGridPrintable);

            MemoryStream stream = new MemoryStream();

            report.ExportToPdf(stream);

            return(File(stream.ToArray(), "application/pdf"));
        }