I’m trying to create a Task that starts at 10am and ends at 2pm on a 24hr calendar. I created this small example of what I thought would do the trick, but I end up with a task that starts at 10am and ends at 3pm. As you can see, i’m creating the schedule from scratch and saving as XML. I’m using Project 2010 when I see this result.
Thank you for writing to Aspose support team.
I have tested this issue using the latest version of Aspose.Tasks for .NET 8.3.0 and was not able to reproduce the same at my end. With a 24-Hour calendar, the task time starts from 10:00 and ends at 14:00. Please have a look at the following sample code that I have used to test this issue at my end.
Project project = new Project();
Calendar calendar = project.Calendars.Add("24 Hour");
var task = project.RootTask.Children.Add("Task");
DateTime startTime = new DateTime(2015, 5, 5, 10, 0, 0);
task.Set(Aspose.Tasks.Tsk.Duration, project.GetDuration(4, TimeUnitType.Hour));
Were you also able to test opening the file in Project 2010? I also have the same result in that getting the start/end dates of the Task in code works fine, but the export seems to be the issue when its opened in Project 2010.
Could you please share a screenshot of the problem you are observing in MS Project 2010? I have noticed that the following code statement returns NULL from your sample code when you create a new Project.
var fullDayCalendar = project.Calendars.GetByName(“24 Hours”);
I have attached the output XML file here for your reference where the start and finish time of the task is as expected. Please check it at your end and share your feedback with us for our reference.
Task Timings in Output XML file:
Sorry, my example was missing some information. Below is a new example that creates the 24 hour calendar, and has two boolean variables that can be changed to show the differences in what I’m seeing in Project 2010 and Aspose Tasks:
This seems to be related to the project calculation modes and recalculations involved. We are currently investigating this issue further at our end and will soon share our feedback with you here.
The issues you have found earlier (filed as TASKS-34003) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.