Example #1
0
        public ActionResult PrintItextchart()
        {
            var            name           = "Documento.pdf";
            ReportServicio reportServicio = new ReportServicio();

            return(File(reportServicio.GeneratePDF2(name), "application/pdf", name));
        }
Example #2
0
        public ActionResult Index()
        {
            //Utilizando RazorEngine
            ReportServicio reportServicio = new ReportServicio();

            ViewBag.html = reportServicio.html();


            //Utilizando Itexchart
            return(View());
        }
Example #3
0
        public ActionResult PrintRotativa()
        {
            string         _headerUrl     = Url.Action("Encabezado", "Home", null, "http");
            ReportServicio reportServicio = new ReportServicio();
            string         footer         = string.Format(" --footer-right \" Page: [page]/[toPage]\"  --footer-font-size \"9\" --header-html  \"{0}\" --print-media-type ", _headerUrl);
            var            html           = reportServicio.html();

            ViewBag.html = html;
            var name    = "Documento.pdf";
            var PDFView = new ViewAsPdf("PrintRotativa", html)
            {
                FileName = name,
                //PageOrientation = Orientation.Portrait,
                //MinimumFontSize = 10,
                PageMargins    = new Margins(20, 20, 40, 20),
                PageSize       = Size.A4,
                CustomSwitches = footer,
                Password       = "******"
            };

            return(PDFView);
            //return View();
        }
Example #4
0
 public void TestMethod1()
 {
     var resultado = new ReportServicio().html();
 }