public ActionResult Index() { //Utilizando RazorEngine ReportServicio reportServicio = new ReportServicio(); ViewBag.html = reportServicio.html(); //Utilizando Itexchart return(View()); }
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(); }