protected void GanttControlExporting_ServerPdfExporting(object sender, Syncfusion.JavaScript.Web.GanttEventArgs e) { PdfExport exp = new PdfExport(); GanttPdfExportSettings settings = new GanttPdfExportSettings(); settings.Theme = GanttExportTheme.FlatLime; settings.Locale = e.Arguments["locale"].ToString(); //Create footer template RectangleF bounds = new RectangleF(0, 0, 762, 25); PdfSolidBrush brush = new PdfSolidBrush(new PdfColor(51, 51, 51)); PdfPen pen = new PdfPen(new PdfColor(200, 200, 200)); PdfFont font = new PdfTrueTypeFont(new Font("Segoe UI", 10), true); PdfStringFormat format = new PdfStringFormat(); format.Alignment = PdfTextAlignment.Center; format.LineAlignment = PdfVerticalAlignment.Middle; PdfPageTemplateElement footer = new PdfPageTemplateElement(bounds); PdfPageNumberField pageNumber = new PdfPageNumberField(font, brush); PdfCompositeField compositeField = new PdfCompositeField(font, brush, "Page {0}", pageNumber); compositeField.StringFormat = format; compositeField.Bounds = footer.Bounds; footer.Graphics.DrawRectangle(pen, bounds); compositeField.Draw(footer.Graphics, new PointF(0, 0)); PdfDocumentTemplate footerTemplate = new PdfDocumentTemplate(); footerTemplate.Bottom = footer; settings.PdfDocumentTemplate = footerTemplate; PdfDocument document = exp.Export(this.GanttControlExporting.Model, (IEnumerable)this.GanttControlExporting.DataSource, settings, false); document = exp.Export(this.GanttControlDesign.Model, (IEnumerable)this.GanttControlDesign.DataSource, settings, document, false); exp.Export(this.GanttControlImplementation.Model, (IEnumerable)this.GanttControlImplementation.DataSource, settings, "Gantt", document, true); }
protected void GanttControlExporting_ServerExcelExporting(object sender, Syncfusion.JavaScript.Web.GanttEventArgs e) { ExcelExport exp = new ExcelExport(); GanttExportSettings settings = new GanttExportSettings(); settings.Theme = ExportTheme.FlatLime; exp.Export(this.GanttControlExporting.Model, (IEnumerable)this.GanttControlExporting.DataSource, "Export.xlsx", ExcelVersion.Excel2010, new GanttExportSettings() { Theme = ExportTheme.FlatLime }); }
protected void GanttControlExporting_ServerPdfExporting(object sender, Syncfusion.JavaScript.Web.GanttEventArgs e) { PdfExport exp = new PdfExport(); GanttPdfExportSettings settings = new GanttPdfExportSettings(); settings.EnableFooter = true; settings.ProjectName = "Project Tracker"; settings.Locale = e.Arguments["locale"].ToString(); settings.Theme = GanttExportTheme.FlatLime; settings.IsFitToWidth = this.EnablePageBreak.Checked; exp.Export(this.GanttControlExporting.Model, (IEnumerable)this.GanttControlExporting.DataSource, settings, "Gantt"); }
protected void GanttControlExporting_ServerExcelExporting(object sender, Syncfusion.JavaScript.Web.GanttEventArgs e) { ExcelExport exp = new ExcelExport(); IWorkbook document = exp.Export(this.GanttControlExporting.Model, (IEnumerable)this.GanttControlExporting.DataSource, new GanttExportSettings() { Theme = ExportTheme.FlatLime }, true, "Planning Phase"); document = exp.Export(this.GanttControlDesign.Model, (IEnumerable)this.GanttControlDesign.DataSource, new GanttExportSettings() { Theme = ExportTheme.FlatLime }, "Export", document, true, "Design Phase"); exp.Export(this.GanttControlImplementation.Model, (IEnumerable)this.GanttControlImplementation.DataSource, new GanttExportSettings() { Theme = ExportTheme.FlatLime }, "Export.xlsx", document, false, "Implementation Phase"); }