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;
}
////// ////// ////// //////
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;
}
////// ////// ////// //////