Setting a Task to A SubProject

Microsoft Project provides the option to set a task to another project, known as a sub-project to the parent project. Aspose.Tasks for Java API provides the same capability to set a task to another sub-project using the Tsk.SubProjectName property.

Setting a Task to a SubProject

 1// For complete examples and data files, please go to
 2// The path to the documents directory.
 3String dataDir = Utils.getDataDir(RenderTaskUsage.class);
 5Project project = new Project(dataDir + "New Project 2010.mpp");
 7Task task = project.getRootTask().getChildren().add("Task 1");
 9// setting new subproject link
10task.set(Tsk.SUBPROJECT_NAME, dataDir +"NewProductDev.mpp");
12// you can see the result in the attached screenshot"Link.mpp", SaveFileFormat.MPP);

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.