Hi,
I am trying export tasks with remaing work and actual work to xml, but not working.
The code:
Project project = new Project();
project.set(Prj.DURATION_FORMAT, TimeUnitType.Hour);
Task rootTask = project.getRootTask();
Resource resource = project.getResources().add(“Resource”);
Task a = rootTask.getChildren().add(“A”);
a.set(Tsk.DURATION, project.getDuration(8));
a.set(Tsk.TYPE, TaskType.FixedDuration);
project.getResourceAssignments().add(a, resource);
a.set(Tsk.ACTUAL_WORK, project.getDuration(8));
a.set(Tsk.REMAINING_WORK, project.getDuration(1));
Task b = project.getRootTask().getChildren().add(“B”);
b.set(Tsk.DURATION, project.getDuration(8));
b.set(Tsk.TYPE, TaskType.FixedDuration);
project.getResourceAssignments().add(b, resource);
b.set(Tsk.ACTUAL_WORK, project.getDuration(7));
b.set(Tsk.REMAINING_WORK, project.getDuration(1));
File temp = new File(“D:\test_work_aspose.xml”);
project.save(temp.getAbsolutePath(), SaveFileFormat.XML);
When I import to ms project the task A with remain work 0hrs and the task B 8hrs.
How to make working correctly?