Hi,
I’m trying to export 2 tasks to XML with the work field set to 80 and 120 hours. Both tasks has 2 days duration.
When I open the XML file on MS-Project, both tasks’ work is set to 16 hours.
Here is a sample of my code:
I’m attaching the XML file and a printscreen.Project newProject = new Project();Task T1 = newProject.RootTask.Children.Add();T1.Set(Tsk.Name, “Teste 1”);T1.Set(Tsk.Start, new DateTime(2015, 9, 5));T1.Set(Tsk.Duration, newProject.GetDuration(2, TimeUnitType.Day));T1.Set(Tsk.ConstraintType, ConstraintType.StartNoEarlierThan);T1.Set(Tsk.ConstraintDate, new DateTime(2015, 9, 5));T1.Set(Tsk.Work, newProject.GetDuration(80, TimeUnitType.Hour));Task T2 = newProject.RootTask.Children.Add();T2.Set(Tsk.Name, “Teste 2”);T2.Set(Tsk.Start, new DateTime(2015, 9, 11));T2.Set(Tsk.Duration, newProject.GetDuration(2, TimeUnitType.Day));T2.Set(Tsk.ConstraintType, ConstraintType.StartNoEarlierThan);T2.Set(Tsk.ConstraintDate, new DateTime(2015, 9, 5));T2.Set(Tsk.Work, newProject.GetDuration(120, TimeUnitType.Hour));newProject.Save(“C:\TestExport.XML”, Aspose.Tasks.Saving.SaveFileFormat.XML);
Thanks