Free Support Forum - aspose.com

How to write Resource Name in MPP

Hi Team,


I want to write Resource name in the MPP. but when I am using the below code which makes use of the project object then the time taken to download is increased drastically.

<span style=“font-size:9.5pt;font-family:Consolas;mso-fareast-font-family:“Times New Roman”;
mso-bidi-font-family:Consolas;color:green;background:white;mso-highlight:white”>//Adding
Resource Name to the TASK.<o:p></o:p>

Resource resourceName = projectWrite.Resources.Add(i.OwnerNm);

resourceName.Set(Rsc.Type, ResourceType.Work);

ResourceAssignment assgn = projectWrite.ResourceAssignments.Add(tsk, resourceName);

(here , i is my tasklist and tsk is the task)

Is there any alternative way to write Resource Name to MPP which doesn't make use of the project object.



Thanks
Abhishek Prasad

Hi Abhishek,


Thank you for writing to Aspose support team.

Resource assignments collection is part of Project object, therefore it is not possible to write resource name to MPP without using project object. Please note that in the latest version Aspose.Tasks for .NET 16.11.0 performance is improved for adding resources to the task. You may please use it to test the scenario.

Please feel free to write us back if you have any other query in this regard.

Hi Team,

I tested with the new dll and found that there is no improvement in the performance.


PFB the time taken to download the MPP when writing resource and when not writing resource:-

When Resource is added

When Resource is added

When Resource is not added.

When Resource is not added.

S No.

Task Count

Time in Seconds using old aspose dll.

Time in Seconds using new aspose dll. (new release)

Time in Seconds using old aspose dll.

Time in Seconds using new aspose dll. (new release)

1

994

235.98

247.877

13.254

14.7


There is gradual increase in time taken when I am adding the resource field in the MPP from 13.2 seconds to 235.98 seconds for 994 items.


Our max requirement is to download till 4000 items for which the downloading time is taking more than 15 minutes which our client is not accepting.


Please let me know if there is a way to simplify this.

Thanks in advance

Regards

Abhishek Prasad

Hi Abhishek,


I have tried this scenario by adding 1000 tasks, 1000 resources and assigning each task a resource. It took about 20 seconds to complete the process. I am afraid that it is not possible for us to see this behavior without your complete running sample application here. Please provide some simple compilable/executable console application to re-produce this scenario here as it will help us to observe the problem and provide assistance accordingly.