We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PDF gantt export

Thread ID:





132923 Sep 28,2017 11:58 AM UTC Oct 3,2017 12:20 PM UTC ASP.NET MVC 3
Tags: Gantt
Asked On September 28, 2017 11:58 AM UTC


I've two questions about the pdf gannt export:

1. In my gantt, I use other colors.... how can I export my colours?

2. Can I fit the page to A3 paper?


Jonesherine Stephen [Syncfusion]
Replied On September 29, 2017 12:46 PM UTC

Hi Manolo, 
Thanks for contacting Syncfusion support 
Query1: In my gantt, I use other colors.... how can I export my colours? 
Solution: In Gantt we can customize the taskbar and parent taskbars by using “ParentTaskbarBackground, ParentProgressbarBackground, TaskbarBackground, ProgressbarBackground” properties. 
We have prepared the Gantt sample with customized taskbars and progress bars and also performed PDF exporting. 
Please find the code example below: 
              //To Map the serverside exporting action              
             .Mappers(mp => mp.ExportToPdfAction("Gantt/ExportToPdf")) 
              //To customize Gantt Taskbars and Progress bar 
             .ToolbarSettings(tool => 
                  tool.ToolbarItems(new List<GanttToolBarItems>() 
Query 2: Can I fit the page to A3 paper? 
Solution: We can customize the size and orientation of the PDF document using PageSettings and PageOrientation properties. 
Please find the code example below: 
public void ExportToPdf(string GanttModel) 
            PdfExport exp = new PdfExport(); 
            PdfDocument document = new PdfDocument(); 
            document.PageSettings.Height = 1587; 
            document.PageSettings.Width = 1123; 
            var DataSource = this.GetEditingDataSource(); 
            GanttProperties obj = ConvertGanttObject(GanttModel); 
            GanttPdfExportSettings settings = new GanttPdfExportSettings(); 
            settings.Theme = GanttExportTheme.FlatSaffron;            
            settings.PageOrientation = PdfPageOrientation.Portrait; 
            exp.Export(obj, (IEnumerable)DataSource, settings, "Gantt", document, true);              
We have also prepared the sample in v15.2.40 for your reference, please find the sample from below location. 
Disclaimer: We have removed bin and obj folder in the given sample for some security reasons, we must include Syncfusion.EJ, Syncfusion.EJ.MVC, Syncfusion.EJ.Export, Syncfusion.Linq.Base, Syncfusion.Pdf.Base,Syncfusion.Compression.Base dlls to perform exporting in Gantt control which is available in Essential Studio installed location.   
Jone sherine P S. 

Replied On October 2, 2017 10:53 AM UTC


I set the colours in queryTaskbarInfo event, so, in function of status I set different colours.

So, I can't set the taskbarcolours in gantt properties

Suriyaprasanth Ravikumar [Syncfusion]
Replied On October 3, 2017 12:20 PM UTC

Hi Manolo, 
In Gantt, currently there is no support to export the Gantt taskbar’s with customized color’s on queryTaskbarInfo client side event. For this we have logged a feature report as “QueryTaskbarInfo event support for Gantt PDF export” and it will be implemented and included in our upcoming Volume 1, 2018 main release which will be expected to out at end of January, 2018.  
By using this support we can do same customization for each taskbar’s done in “queryTaskbarInfo” client side event. 
Please let us know if require further assistance on this. 
Suriyaprasanth R. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon