Read Timephased Data of a Resource

Aspose.Tasks for .NET supports reading a resource’s timephased data from Microsoft Project (MPP) files.

Reading Timephased Resource Data

The Timephased data is retrieved using the Resource object’s TimeScaleData method. For Timephased data of resource work, the

The following piece of code shows reading the Timephased data of a Resource.

 1Project project = new Project("New Project.mpp");
 2
 3// Get the Resource by its ID
 4Resource resource = project.Resources.GetByUid(1);
 5
 6// Print Timephased data of ResourceWork
 7Console.WriteLine("Timephased data of ResourceWork");
 8foreach (TimephasedData td in resource.GetTimephasedData(project.Get(Prj.StartDate), project.Get(Prj.FinishDate)))
 9{
10    Console.Write("Start: " + td.Start.ToShortDateString());
11    Console.Write(" Work: " + td.Value + Environment.NewLine);
12}
13
14// Print Timephased data of ResourceCost
15Console.WriteLine("Timephased data of ResourceCost");
16foreach (TimephasedData td in resource.GetTimephasedData(project.Get(Prj.StartDate), project.Get(Prj.FinishDate), TimephasedDataType.ResourceCost))
17{
18    Console.Write("Start: " + td.Start.ToShortDateString());
19    Console.Write(" Cost: " + td.Value + Environment.NewLine);
20}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.