I’m working on a solution to synchronize dates between the MS Project Plan that we do our scheduling in and our internal database. I’ve been able to read the dates out of the project plan and thus, update our internal database without issues. When attempting to update dates in the other direction (update the MSP plan based on dates from the database), I’m getting mixed results. I decided to start from the basics and created a very simple project plan and I’m also getting results there that I can’t say I understand. I’m looking for the general rules for updating dates in our project plans using .Tasks for .NET. I’m running with the latest version of .Tasks and am working with MSP 2007 files.
Hi Michael,
Thank you for your inquiry.
I would like to address your concerns one by one and share my findings here with you. The tests have been carried out using the latest version of Aspose.Tasks for .NET 8.2.0 and the following code sample (which simply sets the Start and Actual Start of the task). I have also attached the output of the following code for your kind reference. Please feel free to write us back for further discussion if your have any concerns about the difference in results I have shared below.
1. When I attempt to simply change the Start Date to 4/20/15, it increases the duration to 4 days, leaving the original Finish Date alone.
Findings: I was not able to observe the issue. In the attached screenshot, you can see that the start date is changed to 20/4/2015 and duration remains at 2 days. The same can be found in the saved file StartChagnedTo_20150420.mpp that is attached here for your reference.
2. If I change the Start Date to 4/27 (after the original), it correctly moves the Finish Date to 4/28 and leaves the duration at 2 days.
Findings: The results are same at my end as well. Resultant file, named StartChagnedTo_20150427.mpp is attached here for your reference.
3. In addition to this behavior, when I attempted to instead write to the Actual Start (to clarify, the Start date was NOT touched in this example), trying to test the expected result outlined in point (a) above to 4/17/15, using the same test file, the saved file did not have anything in the Actual Start column. The Start Date did change to 4/17, but again, the fixed duration of 2 days was not adhered to, but instead resulted in a new duration of 5 days, with the original Finish Date of 4/23 left in tact.
Findings: I was able to observe the issue where the summary task Actual Start field contains NA in this case and have logged this as TASKS-33983 in our bug tracking system for further investigation by our product team. However, I would also like to share that the start date is changed to 4/17/2015, Finish Date is set to 4/20/2015 and duration remains 2 days as expected. Resultant file, named ActualStartChagnedTo_20150417.mpp is attached here for your reference.
Code:
static void Check622326()
{
Project project = new Project("622326\\TestSyncProject.mpp");
Task task = project.RootTask.Children.GetById(1);
Console.WriteLine("************ Task Original Information ************");
PrintTask(task);
Console.WriteLine("************ Changing Task Start Date *************");
task.Set(Tsk.Start, new DateTime(2015, 4, 20));
PrintTask(task);
project.Save("622326\\StartChagnedTo_20150420.mpp", SaveFileFormat.MPP);
Console.WriteLine("************ Changing Task Start Date *************");
task.Set(Tsk.Start, new DateTime(2015, 4, 27));
PrintTask(task);
project.Save("622326\\StartChagnedTo_20150427.mpp", SaveFileFormat.MPP);
Console.WriteLine("\n************ Changing Task Actual Start Date ************");
task.Set(Tsk.ActualStart, new DateTime(2015, 4, 17, 8, 0, 0));
PrintTask(task);
Console.WriteLine("\n************ Summary Task Information ************");
PrintTask(project.RootTask.Children.GetById(0));
project.Save("622326\\ActualStartChagnedTo_20150417.mpp", SaveFileFormat.MPP);
}
static void PrintTask(Task task)
{
Console.WriteLine(task.Get(Tsk.Name));
Console.WriteLine("Start: " + task.Get(Tsk.Start));
Console.WriteLine("Finish: " + task.Get(Tsk.Finish));
Console.WriteLine("Duration: " + task.Get(Tsk.Duration));
Console.WriteLine("Actual Start: " + task.Get(Tsk.ActualStart));
Console.WriteLine("Actual Finish: " + task.Get(Tsk.ActualFinish));
Console.WriteLine("Percent Complete: " + task.Get(Tsk.PercentComplete));
}
PS: The part of code for changing task’s Start date was commented when testing the Actual Start date issue.
The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.