Free Support Forum - aspose.com

Re-Calculating Dates and Cost

If I change an individual task’s Start Date or Cost. Is Aspose.Tasks able to recalculate predecessor and parent tasks to reflect those changes throughout the project?




Hi Steve,

Thanks for considering Aspose.

Sure. In Aspose.Tasks for .NET, ProjectWriter class exports the project after performing the such recalculations. Attached is a simple MPP project file having some predecessor and cost. In the following code sample, we have updated the start date and the cost using Aspose.Tasks for .NET API. The corresponding predecessor and the cost will be automatically updated in the output XML project file.

//Instantiate ProjectReader
ProjectReader reader = new ProjectReader();
//Load the project file
Project project = reader.Read(@“E:\prj.mpp”);
//Get second task
Task tsk = project.GetTaskByUid(2);
//Change the start date of the second task
tsk.ActualStart = DateTime.Parse(“04-Oct-2010”);
//tsk.ConstraintType = ConstraintType.MustStartOn;
//Get third Resource
Resource res = project.GetResourceByUid(3);
//Update cost of third resource
res.CostPerUse = 55;
//Instantiate ProjectWriter
ProjectWriter writer = new ProjectWriter();
//Write the project to disk
writer.Write(project, @“E:\prjXML.xml”, TasksDataFormat.XML);

Both prj.mpp and prjXML.xml are attached.

Thanks for the quick response!

I tried this out and have a few more questions:

1. Is it possible to also recalculate ACWP, BCWP, and BCWS based on today’s date and % complete?
2. I tried loading a blank MPP file creating tasks manually and writing back out to MPP. I ended up with a blank project again. However if I wrote out to a XML file I do see the data. Is there something I am missing with the mpp?
3. Is it possible to perform the recalculations in memory without rewriting the project to disk?

Thanks again.

Hi Steve,

Please accept my apology for the late response as I was investigating on your inquiry.

ssamnadda:

1. Is it possible to also recalculate ACWP, BCWP, and BCWS based on today’s date and % complete?


We have recently implemented reading ACWP, BCWP and BCWS reading from MPP files. Such data is not stored as part of the MPP file, rather they are calculated values. For more information on this topic, please have a look on this discussion.

As far as the complete recalculation of the project data is concerned, we have an issue with id 15459 on our Issue Tracking System which is expected to be resolved in our October / November release. I have linked this thread with this issue as well for further updates regarding this issue.

ssamnadda:


2. I tried loading a blank MPP file creating tasks manually and writing
back out to MPP. I ended up with a blank project again. However if I
wrote out to a XML file I do see the data. Is there something I am
missing with the mpp?



Unfortunately, complete MPP data writing support is not available at the moment. So far, we have implemented the reading of MPP files, updating the common project properties (as exposed by Project object) and then writing back to the project file in its original MPP format. We plan to continuously incorporate the more MPP data writing support with the new future releases as it is a huge task to be accomplished at once.

ssamnadda:

  1. Is it possible to perform the recalculations in memory without rewriting the project to disk?


I have created an issue with id 20454 as sub-task to issue 15459 as mentioned in point 1. Our development team will work on it and you will be informed when there are updated on these issues.

Many Thanks

Thanks for the info. I have been using Aspose.Tasks to read baselines, ACWP, and BCWS. I found that BCWP was incorrect though. You may want to look into this or I may be doing something wrong!

No problem though. In the meantime, I have written my own calculations for BCWP based BAC and percent complete. :)

Hi Steve,

Thanks for further feedback.

In fact, we have found some inconsistencies when BCWP is calculated by MS Project. Please visit some related resources:

http://www.eggheadcafe.com/software/aspnet/35847882/bcwp-inconsistency.aspx
http://office.microsoft.com/en-us/project-help/bcwp-earned-value-or-ev-fields-HP010173396.aspx?CTT=5&origin=HA010370279
http://kbalertz.com/feedback.aspx?kbnumber=75051

Due to such inconsistencies, we have implemented BCWP calculations which work in most common cases (but not for all cases). We will fix this issue once these inconsistencies are removed. Once again, thanks for your positive feedback.

Kind Regards

Thanks for posting those interesting articles. Whatever the issue is, I believe I can continue to calculate BCWP at the task level and rollup this up to summary task through code.

I have run into a new problem, this time with BCWS. At the task level, BCWS is being read correctly throught the first 65-75 tasks than it starts returning zero for the the rest of the tasks. The project status date is set to today's date and the tasks in question are all in progress for the date range. Do you have any idea why this may be?

If I have to also calculate BCWS based on the following formula, do you expose a field that represents "Planned % Complete"?

BCWS = [Planned % Complete] x [BAC]

Thanks!

Hi,


Now in Aspose.Tasks we use calculation of BCWS values based on this algorithm. But the baseline timephased data is still internal, we are going to add the data reading in next release (end of October).

Sorry for inconvenience.

Could you explain a little more about how the recalculations occur? It seems to me that Aspose.Tasks isn’t performing any recalculations- it is simply setting fields in the XML file and MS Project does all the recalculations once the file is opened in MS Project.

I put some prints in your supplied code:

//Instantiate ProjectReader
ProjectReader reader = new ProjectReader();
//Load the project file
Project project = reader.Read(@“C:\prj.mpp”);
//Get second task
Task tsk = project.GetTaskByUid(2);

Console.WriteLine(“1_task(2)= fin:” + tsk.Finish + " aFin:" + tsk.ActualFinish);

//Change the start date of the second task
tsk.ActualStart = DateTime.Parse(“04-Oct-2010”);

Console.WriteLine(“2_task(2)= fin:” + tsk.Finish + " aFin:" + tsk.ActualFinish);

ProjectWriter writer = new ProjectWriter();
//Write the project to disk
writer.Write(project, @“C:\prjXML1.xml”, TasksDataFormat.XML);

tsk = project.GetTaskByUid(2);
Console.WriteLine(“3_task(2)= fin:” + tsk.Finish + " aFin:" + tsk.ActualFinish);

project = reader.Read(@“C:\prjXML1.xml”);
tsk = project.GetTaskByUid(2);
Console.WriteLine(“4_task(2)= fin:” + tsk.Finish + " aFin:" + tsk.ActualFinish);

tsk = project.GetTaskByUid(3);
Console.WriteLine(“5_task(3)= fin:” + tsk.Finish + " aFin:" + tsk.ActualFinish + " start:" + tsk.Start + " aStart:" + tsk.ActualStart);

And here is the output:
1_task(2)= fin:9/30/2010 5:00:00 PM aFin:1/1/0001 12:00:00 AM
2_task(2)= fin:9/30/2010 5:00:00 PM aFin:1/1/0001 12:00:00 AM
3_task(2)= fin:9/30/2010 5:00:00 PM aFin:1/1/0001 12:00:00 AM
4_task(2)= fin:9/30/2010 5:00:00 PM aFin:1/1/0001 12:00:00 AM
5_task(3)= fin:10/1/2010 5:00:00 PM aFin:1/1/0001 12:00:00 AM start:10/1/2010 8:00:00 AM aStart:1/1/0001 12:00:00 AM

Please advise if I am doing something wrong. I would definitely purchase Aspose.Tasks if the automatic recalculations worked. I currently don’t see a point in spending the money on Aspose.Tasks if I have to have MS Project installed on the server to perform the recalculations- I might as well use Office Automation.
Thanks

Hi,


Thank you a lot for your question!

Unfortunately the project recalculation functionality is still under development. We are going to implement it in the beginning of the next year (Q1’2011).

The problem is that one task duration changing could impact whole project data like costs, works, durations, some resources could be unavailable, some date restriction like deadlines could be broken etc. We have to put it all in account and provide customer with interfaces to resolve the problems.

Sorry for the inconvenience.

Thank you for your response and clarification. The recalculation engine is extremely complicated. I look forward to seeing how your implementation works. If it works well, I will definitely be a customer.

The issues you have found earlier (filed as TASKS-15459) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)

The issues you have found earlier (filed as TASKS-20454) 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.