MS Project Integration - How to set ActualStart/Finish/Work?

S

Sharjeel

We have a Basic Task management System, with task id, description, work,
planned & actual dates. I want to synchronize this with MS Project
Professional 2007.

The idea is to create a project plan in ms project & push this data to
System. And after that pull the Actual info from System & update ms project
file.

I am sending the Baseline data as planned data to System & setting Actual
data of MS Project by reading from System.

I am able to map most of System's fields with MS Project. The problem comes
when i am trying to update 'Actual Start/Finish/Work' fields. Instead of
updating those fields it actually updates 'Start/Finish/Work' fields.

When i do it manually it updates both ( that is fine as I have set the
Baseline ). But programmatically i am not able to achieve the same.

About the program to do this sync
I have written a COM addin using VS 2005, which interacts between MS Project
& System to synchronize the data programmetically.

////// ////// SAMPLE CODE ////// //////
foreach (MSProject.Task task in project.Tasks)
{
Action action = new Action();
action.Nr = (decimal)task.Number10;
action.Descr = task.Name;
action.PlannedStartDate = (DateTime)task.BaselineStart;
action.PlannedEndDate = (DateTime)task.BaselineFinish;
action.AllottedHrs = (decimal)((double)task.BaselineWork) / 60;
action.Resources = new
List<Resource(ResourceSync.GetResources(task.Resources).Values);

UpdateItem(ref action);

task.ActualStart = action.ActualStartDate.Value;
task.ActualFinish = action.ActualEndDate.Value;
task.ActualWork = action.TakenHrs * 60;
}
////// ////// ////// //////
 
V

virsharma

Our scenario was also similar to yours. We have created a consol application
and using PSI we inserted all tasks data into project and published that, and
you can see its update via Project Professional.

Regards,
virsharma
 
S

Sharjeel

Hello Virsharma,

Yeah it looks straight forward to me & it should have worked.
But somehow it is not updating Actual values.

Regards,
Sharjeel
 
D

Danny Raharja

Hello Virsharma and Sharjeel,

I'm also trying to manipulate the actual, start date and end date for PWA
using PSI.
for the first time, I found this
http://blogs.msdn.com/brismith/archive/2007/02/02/adding-timephased-actual-work-through-the-psi.aspx

below is my code to update the assignment.

//////////////////////////////Start of Code //////////////////////////////
StringBuilder changeXml = new StringBuilder();

changeXml.AppendFormat("<Changes><Proj ID=\"{0}\">", projectUid.ToString());

changeXml.AppendFormat("<Assn ID=\"{0}\">", assn.ToString());

changeXml.AppendFormat("<PeriodChange PID=\"{0}\" Start= \"{2}\"
End=\"{3}\">{1}</PeriodChange>",

"251658246", 6 * 10000 * hour, startDate.ToString("s"),
endDate.ToString("s")); // the 251658246 representing job type. in this
case, it is planned work.

changeXml.AppendFormat("<PeriodChange PID=\"{0}\" Start= \"{2}\"
End=\"{3}\">{1}</PeriodChange>",

"251658250", 6 * 10000 * hour, startDate.ToString("s"),
endDate.ToString("s")); //// the 251658250 representing job type. in this
case, it is actual work.

changeXml.Append("</Assn></Proj></Changes>");

statusingSvc.Credentials = CredentialCache.DefaultNetworkCredentials;

statusingSvc.UpdateStatus(changeXml.ToString());

statusingSvc.SubmitStatus(new Guid[] { assn }, "Updated actual work");

//////////////////////////////End of Code //////////////////////////////

PID can be found through MS Office 2007 SDK help with using "Supported
Project Fields and Field Information for Statusing ChangeXML" as keyword.

I hope it can give a better clue for you guys to work more.





Regards,

Danny Raharja
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top