When we use Calculation.Mode = Calculation Mode.None, the task dates are incorrect.
License license = new License(); license.SetLicense("Aspose.Tasks.lic"); Project project = new Project("Template.mpp"); project.CalculationMode = CalculationMode.None; Task tsk1 = project.RootTask.Children.Add("Task 1"); tsk1.Set(Tsk.IsManual, false); tsk1.Set(Tsk.Start, DateTime.ParseExact("2018-01-05", "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture)); tsk1.Set(Tsk.Duration, project.GetDuration(2, TimeUnitType.Day)); Task tsk2 = project.RootTask.Children.Add("Task 2"); tsk2.Set(Tsk.IsManual, false); tsk2.Set(Tsk.Start, DateTime.ParseExact("2018-02-13", "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture)); tsk2.Set(Tsk.Duration, project.GetDuration(2, TimeUnitType.Day)); project.Save(@"output.xml", Aspose.Tasks.Saving.SaveFileFormat.XML); project.Save(@"output.mpp", Aspose.Tasks.Saving.SaveFileFormat.MPP);
Here is the result:
DateAuto.png (2.8 KB)
License license = new License(); license.SetLicense("Aspose.Tasks.lic"); Project project = new Project("Template.mpp"); project.CalculationMode = CalculationMode.None; Task tsk1 = project.RootTask.Children.Add("Task 1"); tsk1.Set(Tsk.IsManual, true); tsk1.Set(Tsk.Start, DateTime.ParseExact("2018-01-05", "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture)); tsk1.Set(Tsk.Duration, project.GetDuration(2, TimeUnitType.Day)); Task tsk2 = project.RootTask.Children.Add("Task 2"); tsk2.Set(Tsk.IsManual, true); tsk2.Set(Tsk.Start, DateTime.ParseExact("2018-02-13", "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture)); tsk2.Set(Tsk.Duration, project.GetDuration(2, TimeUnitType.Day)); project.Save(@"output.xml", Aspose.Tasks.Saving.SaveFileFormat.XML); project.Save(@"output.mpp", Aspose.Tasks.Saving.SaveFileFormat.MPP);
Here is the result:
DateMan.png (3.1 KB)
Could you help us?