protected void Schedule1_OnServerExportPDF(object sender, ScheduleEventArgs e) { ScheduleProperties scheduleObject = new SchedulePDFExport().ScheduleSerializeModel(e.Arguments["model"].ToString()); scheduleObject.BlockoutSettings.DataSource = (IEnumerable) new JavaScriptSerializer().Deserialize(e.Arguments["blockedApp"].ToString(), typeof(IEnumerable)); IEnumerable scheduleAppointments = (IEnumerable) new JavaScriptSerializer().Deserialize(e.Arguments["processedApp"].ToString(), typeof(IEnumerable)); PdfPageSettings pageSettings = new PdfPageSettings(50f) { Orientation = PdfPageOrientation.Landscape }; PdfDocument document = new PdfExport().Export(scheduleObject, scheduleAppointments, ExportTheme.FlatLime, Request.Form["locale"], pageSettings); document.Save("Schedule.pdf", Response, HttpReadType.Save); }
public ActionResult ExportAsPDF(string scheduleModel) { ScheduleProperties scheduleObject = new SchedulePDFExport().ScheduleSerializeModel(Request.Form["ScheduleModel"]); scheduleObject.BlockoutSettings.DataSource = (IEnumerable) new JavaScriptSerializer().Deserialize(Request.Form["ScheduleProcesedIntervalsApps"], typeof(IEnumerable)); IEnumerable scheduleAppointments = (IEnumerable) new JavaScriptSerializer().Deserialize(Request.Form["ScheduleProcesedApps"], typeof(IEnumerable)); PdfPageSettings pageSettings = new PdfPageSettings(50f) { Orientation = PdfPageOrientation.Landscape }; PdfDocument document = new PdfExport().Export(scheduleObject, scheduleAppointments, ExportTheme.FlatSaffron, Request.Form["locale"], pageSettings); document.Save("Schedule.pdf", HttpContext.ApplicationInstance.Response, HttpReadType.Save); return(RedirectToAction("PDFExportController")); }