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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PDF gantt export

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hi,

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?

Thanks

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: 
@(Html.EJ().Gantt("GanttContainer") 
              //To Map the serverside exporting action              
             .Mappers(mp => mp.ExportToPdfAction("Gantt/ExportToPdf")) 
              //To customize Gantt Taskbars and Progress bar 
             .ParentTaskbarBackground("#56bc0d") 
             .ParentProgressbarBackground("#933969") 
             .TaskbarBackground("#a4b9db") 
             .ProgressbarBackground("#2f87c6")              
             .ToolbarSettings(tool => 
              { 
                  tool.ShowToolbar(true); 
                  tool.ToolbarItems(new List<GanttToolBarItems>() 
                 { 
                      GanttToolBarItems.PdfExport, 
                 }); 
              }))@(Html.EJ().ScriptManager()) 
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.   
Regards, 
Jone sherine P S. 



Manolo
Replied On October 2, 2017 10:53 AM UTC

Hi,

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. 
 
Thanks, 
Suriyaprasanth R. 


CONFIRMATION

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.

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

;