Hello,
could you give me an example of how to get the data if there’re multiple data in resource names column, the data is separated by ‘,’ in the mpp file
Hello,
could you give me an example of how to get the data if there’re multiple data in resource names column, the data is separated by ‘,’ in the mpp file
Hi,
Thank you for writing to Aspose support team.
You may please use following code with the attached sample MPP file to display multiple resource names displayed against each task in the MPP. For each task a collection of resource assignments is present containing a resource in each assignment. You need your own logic to display the resource names seperated by comma. Please give it a try and share the feedback.
Project proj = new Project("Sample.mpp");
ChildTasksCollector collector = new ChildTasksCollector(); // Create a ChildTasksCollector instance
TaskUtils.Apply(proj.RootTask, collector, 1); // Collect all the tasks from RootTask using TaskUtils
foreach (Task tsk in collector.Tasks)
{
if (tsk.Get(Tsk.Id) == 0)
continue;
Console.Write(tsk.Get(Tsk.Name) + "=> ");
//Read resource name
foreach (ResourceAssignment ass in tsk.Assignments)
{
Console.Write(ass.Get(Asn.Resource).Get(Rsc.Name)+",");
}
Console.WriteLine();
}