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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Export Excel or Pdf from Gantt control

Thread ID:

Created:

Updated:

Platform:

Replies:

119538 Jul 6,2015 04:04 PM UTC Nov 29,2016 05:56 PM UTC ASP.NET MVC 4
loading
Tags: Schedule
Division SAM
Asked On July 6, 2015 04:04 PM UTC

 
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

Mahalakshmi Karthikeyan [Syncfusion]
Replied On 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.


Division SAM
Replied On July 7, 2015 11:59 AM UTC

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

Velmurugan S [Syncfusion]
Replied On 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


Jonesherine Stephen [Syncfusion]
Replied On 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
  


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

;