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. Image for the cookie policy date
close icon

Export Excel or Pdf from Gantt control

 
Hi

I’m working with the Gantt control, and I like to know if is possible to do an Excel or Pdf exprot with this control.
 
Best regards

4 Replies

MK Mahalakshmi Karthikeyan Syncfusion Team July 7, 2015 11:50 AM UTC

Hi Division,

Thanks for using Syncfusion Product.

For your Kind information, currently there is no support to export the Gantt chart to excel or pdf. Also we have already logged a feature report on “Support for exporting Gantt chart” regarding this. A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Please let us know if you need more information on this.

Regards,

Mahalakshmi K.



DS Division SAM July 7, 2015 11:59 AM UTC

 
Ok, and is possible to do an Excel export from a Schedule control?
 
Best regards


VS Velmurugan S Syncfusion Team July 8, 2015 11:14 AM UTC

Hi Division,

Thanks for using Syncfusion Product.
Currently there is no support to export the Schedule data to excel. Also we have already logged a feature report on “Need to provide support for exporting schedule appointments data into xls file” regarding this. A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Please let me know if you have any questions.

Regards,
Velmurugan



JS Jonesherine Stephen Syncfusion Team November 29, 2016 05:56 PM UTC

Hi Division, 
We have implemented the feature regarding “Support for excel export in Gantt”. 
We have prepared the sample and performed exporting action in server side. 
Please find the code example below: 
[controller] 
using Syncfusion.EJ.Export; 
using Syncfusion.XlsIO; 
using Syncfusion.JavaScript.Models; 
public void ExportToExcel(string GanttModel) 
        { 
            ExcelExport exp = new ExcelExport(); 
            var DataSource = this.GetEditingDataSource(); 
            GanttProperties obj = ConvertGanttObject(GanttModel); 
            exp.Export(obj, DataSource, "GanttExport.xlsx", ExcelVersion.Excel2010, new GanttExportSettings() { Theme = ExportTheme.FlatSaffron }); 
        } 
 
        private GanttProperties ConvertGanttObject(string gridProperty) 
        { 
            JavaScriptSerializer serializer = new JavaScriptSerializer(); 
            IEnumerable div = (IEnumerable)serializer.Deserialize(gridProperty, typeof(IEnumerable)); 
            GanttProperties gridProp = new GanttProperties(); 
            foreach (KeyValuePair<string, object> ds in div) 
            { 
                var property = gridProp.GetType().GetProperty(ds.Key, BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase); 
                if (property != null) 
                { 
                    Type type = property.PropertyType; 
                    string serialize = serializer.Serialize(ds.Value); 
                    object value = serializer.Deserialize(serialize, type); 
                    property.SetValue(gridProp, value, null); 
                } 
            } 
            return gridProp; 
        } 
 To call the server side exporting method we need to map “mappers” in client side and we need to include “ExcelExport” item in Toolbar to render the exporting icon in Toolbar 
Please find the code example below: 
[view] 
@(Html.EJ().Gantt("GanttContainer")              
             .Mappers(mp => mp.ExportToExcelAction("Gantt/ExportToExcel")) 
             .ToolbarSettings(tool => 
              { 
                  tool.ShowToolbar(true); 
                  tool.ToolbarItems(new List<GanttToolBarItems>() 
                 { 
                      GanttToolBarItems.ExcelExport, 
                 }); 
              }) 
              .Datasource(ViewBag.datasource) 
    )@(Html.EJ().ScriptManager()) 
Please find the screen shot of exported file for your reference: 
 
We have also prepared the sample based on this. 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.XlsIO.Base, Syncfusion.Linq.Base, Syncfusion.Compression.Base dlls to perform exporting in Gantt control which is available in Essential Studio installed location.   
Please let us know if you require further assistance on this.
Regards, 
Jone sherine P S
  


Loader.
Live Chat Icon For mobile
Up arrow icon