Export data

Hi,

we have seen that it is possible to export data for MS Project.

I asked you if it is also possible to export data also in other format, in order to use data not only in MS Project.

Best regards
Gian Piero Truccolo

9 Replies

RS Ramya Soundar Rajan Syncfusion Team December 1, 2020 11:40 AM UTC

Hi Gian,  
   
Greetings from Syncfusion.  
   
We would like to let you know that the export support only for the XML files and image in GanttControl. Please refer to the below help document link for more information.  
   
   
So, can you please provide the detailed information like the mentioned format type or reference link about the query mentioned: “it is also possible to export data also in other formats”. This will be helpful for us to proceed further.  
 
Regards, 
Ramya S 



GI Gian December 1, 2020 01:05 PM UTC

Hi,

i have just seen that document.

For example the first fomat could be helpful is an image, so the possibility to retrieve a bitmap of the gantt.

Regarding the timeline i see that it is possible to manage hours in task with a zoom but  not minute and seconds, can you confirm this please?

Best regards
Gian Piero Truccolo


RS Ramya Soundar Rajan Syncfusion Team December 2, 2020 02:41 PM UTC

Hi Gian, 
 
Query 1: For example the first fomat could be helpful is an image, so the possibility to retrieve a bitmap of the gantt. 
 
As we informed earlier, you can export as image in the GanttControl. Please refer the below sample. 
 
 
Query 2: Regarding the timeline i see that it is possible to manage hours in task with a zoom but not minute and seconds, can you confirm this please? 
 
You can show the minutes and seconds in the Gantt Schedule by using the enum ScheduleType as MinutesWithSeconds as per in the below code snippet. 
 
        <syncfusion:GanttControl x:Name="Gantt" ScheduleType="MinutesWithSeconds" 
                                Loaded="GanttGrid_Loaded" > 
              
          
 
        </ syncfusion:GanttControl> 
 
You can also to define your own schedule for Gantt to track the progress of projects. You can define the schedule for any measurement unit or for different types of date time formats namely quarterly basis scale and so on. Please refer the below help document link. 
 
 
Regards, 
Ramya S 



RU Russ March 13, 2021 04:38 PM UTC

How do you export to XML if the observable collection is a type other than TaskDetails?  I'm using my own Task model.  Is this possible?

With exporting to image how do you export the entire chart and grid?  for example, if you want to print the chart as you see it on screen.


SS Sridevi Sivakumar Syncfusion Team March 15, 2021 02:19 PM UTC

Hi Gian Piero Truccolo,

Query: How do you export to XML if the observable collection is a type other than TaskDetails?  I'm using my own Task model.  Is this possible?

Yes, we have achieved your requirement as per the below code snippet


Code snippet:[MainWindow.cs]

  private void ButtonBase_OnClick(object sender, RoutedEventArgs e)

        {

            Microsoft.Win32.SaveFileDialog saveFileDialog = new Microsoft.Win32.SaveFileDialog();

            saveFileDialog.Filter = "XML Files (*.XML)|*.xml";

            saveFileDialog.FileName = "Untitled";

            if (saveFileDialog.ShowDialog() == true)

            {

                if (!String.IsNullOrEmpty(saveFileDialog.FileName))

                {

                    ExportToXML(Gantt.ItemsSource as IEnumerable, saveFileDialog.FileName);

                }

            }

 

        }

        public static void ExportToXML(IEnumerable taskDetailsCollection, string FilePath)

        {

            // Initializing the variables to create objects for exporting.

            Project project = new Project();

            Dictionary<Task, Syncfusion.ProjIO.Task> likendTasks = new Dictionary<Task, Syncfusion.ProjIO.Task>();

            Dictionary<Task, Syncfusion.ProjIO.Task> linearTasks = new Dictionary<Task, Syncfusion.ProjIO.Task>();

            List<Assignment> assignedTasks = new List<Assignment>();

 

            // Creating the poject tasks and getting the input for assignment and predecessor

            project.RootTask.Children = CreateProjectTasks(taskDetailsCollection, likendTasks, assignedTasks, linearTasks);

 

            project.CalculateTaskIDs();

 

            // Creating predecessors

            if (likendTasks.Count > 0)

                UpdateLinkedTasks(likendTasks, linearTasks);

 

            // Creating resource assignment

            if (assignedTasks.Count > 0)

            {

                project.Assignments.AddRange(assignedTasks);

 

                project.Resources = assignedTasks.Select((a) => a.Resource).ToList();

            }

 

            // Calculating UIDs of tasks and resources

            project.CalculateResourceIDs();

 

            // Exporting the current project to xml

            project.Save(FilePath);

        }

 

Please have a sample from the below link

https://www.syncfusion.com/downloads/support/forum/160178/ze/ExportXML1146884535

Query 2 : With exporting to image how do you export the entire chart and grid? 

We have analysed your requirement and we don't have a support to export the grid as an image. We can export the grid in an excel format.

 

And we can export a chart as an image, we have prepared a sample for your requirement. Please have a sample from the below link

https://www.syncfusion.com/downloads/support/forum/160178/ze/ExportasImage925122485

 

Let us know if you need any further assistance.

 

Regards,

Sridevi S.

 



RU Russ March 15, 2021 05:41 PM UTC

Awesome on the XML!!

What I meant with the image export was grid and chart combined.  For now, I've created a method that exports and image of the grid and an image of the chart.  At some point, I'll stitch them together into a single image. 

Thank you


SS Sridevi Sivakumar Syncfusion Team March 16, 2021 11:43 AM UTC

Hi Gian Piero Truccolo,

Thanks for your update.

Let us know if you need any further assistance.

Regards,
Sridevi S. 



RU Russ March 17, 2021 08:03 AM UTC

Thanks.  Your external property binding sample posted above the task model contained an ObservableCollection Predecessor.  If using another model to store the predecessor info what are the minimum requirements?  Is that even possible?  


SS Sridevi Sivakumar Syncfusion Team March 17, 2021 02:05 PM UTC

Hi Russ,

Query: If using another model to store the predecessor info what are the minimum requirements?  Is that even possible?

We have analyzed your query and we would like to inform you that gantt control does not have support for custom predecessor model class. If you want to show the  predecessor, you have to create our gantt control predecessor class collection then link with tasks. Otherwise, you can load tasks without predecessor collection.

Let us know if you need any further assistance.

Regards,
Sridevi S. 
 


Loader.
Up arrow icon