Free Support Forum - aspose.com

Task links not maintained in MSP 2013 for MPP created by Aspose.Tasks

Hi,


I am using aspose tasks to create few tasks and then link them using TaskLink. Some times I cant see these links when open this file in Microsoft Project 2013 whereas same MPP file when opened in MSP 2010, displays link properly. What can be the reason??

Any hint!


Hi,


Thanks for writing to Aspose.Tasks support team.

I have analyzed the scenario and have successfully re-produced the issue here using following sample code.

ProjectReader pr = new ProjectReader();
Project project = pr.Read(“Blank2010.mpp”);
//Set Proejct Calendar
project.Calendar = Aspose.Tasks.Calendar.MakeStandardCalendar();

//Define a Summary task
Task summary = new Task(“Summary 1”);

// One day duration task (duration by default, if not set explicitly)
Task task1 = new Task(“Task 1”);
task1.Duration = new TimeSpan(8, 0, 0);

// Two days duration task
Task task2 = new Task(“Task 2”);
task2.Duration = new TimeSpan(16, 0, 0);

//Add the tasks to the Summary Task
summary.Children.Add(task1);
summary.Children.Add(task2);

// Define Root Task and Add summary to RootTask
project.RootTask = new Task(“Root task”);
project.RootTask.Children.Add(summary);


// Calculate Uids, Ids and update reference
project.CalcCalendarUids();
project.CalcTaskUids();
project.CalcTaskIds();
project.UpdateReferences();

// Set first task start date, also set project start date
task1.Start = project.Calendar.GetNextWorkingDayStart(new DateTime(2013, 4, 23));
project.StartDate = task1.Start;

//check dates before linking the tasks and their summary task
Console.WriteLine(“Dates BEFORE linking the tasks and their summary task”);
Console.WriteLine("task1 Start = " + task1.Start.ToString());
Console.WriteLine("task1 Finish = " + task1.Finish.ToString());
Console.WriteLine("task2 Start = " + task2.Start.ToString());
Console.WriteLine("task2 Finish = " + task2.Finish.ToString());
Console.WriteLine(“summary Start = " + summary.Start.ToString());
Console.WriteLine(“summary Finish = " + summary.Finish.ToString());

project.Save(“BeforeLinking.mpp”, Aspose.Tasks.Saving.SaveFileFormat.MPP);

// Link two tasks together.
TaskLink link1 = new TaskLink(task1, task2, TaskLinkType.FinishToStart);
project.TaskLinks.Add(link1);


// Check that linked second task and theirs summary task set dates correctly
Console.WriteLine(”\n\nDates AFTER linking the tasks and their summary task”);
Console.WriteLine("task1 Start = " + task1.Start.ToString());
Console.WriteLine("task1 Finish = " + task1.Finish.ToString());
Console.WriteLine("task2 Start = " + task2.Start.ToString());
Console.WriteLine("task2 Finish = " + task2.Finish.ToString());
Console.WriteLine("summary Start = " + summary.Start.ToString());
Console.WriteLine("summary Finish = " + summary.Finish.ToString());

project.Save(“AfterLinking.mpp”, Aspose.Tasks.Saving.SaveFileFormat.MPP);

I have logged this issue under id: TASKS-33340. Development team will look into it and I will write back here to share the development team feedback.

Please feel free to write us if you have any other query related to Aspose.Tasks.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.