Managing Assignment Cost
Contents
[
Hide
Show
]Managing Assignment Cost
The ResourceAssignment class exposes several properties used to manage assignment cost:
- Cost represents an assignment’s total project cost (decimal).
- BCWP represents the budgeted cost of work to date on an assignment (double).
- BCWS represents the budgeted cost of work scheduled for an assignment (double).
- ACWP represents the actual cost of the work carried out on an assignment to date (double).
To view assignment costs in Microsoft Project:
- On the Task Usage page, select the Insert menu and then Column.
- Add columns.
Getting Assignment Costs with Aspose.Tasks
The following code example demonstrates how to get task costs using Aspose.Tasks.
1// Create project instance
2System::SharedPtr<Project> project1 = System::MakeObject<Project>(dataDir + u"ResourceAssignmentCosts.mpp");
3
4// Print resource assignment costs
5
6{
7 auto ra_enumerator = (project1->get_ResourceAssignments())->GetEnumerator();
8 decltype(ra_enumerator->get_Current()) ra;
9 while (ra_enumerator->MoveNext() && (ra = ra_enumerator->get_Current(), true))
10 {
11 System::Console::WriteLine(ra->Get<System::Decimal>(Asn::Cost()));
12 System::Console::WriteLine(ra->Get<double>(Asn::ACWP()));
13 System::Console::WriteLine(ra->Get<double>(Asn::BCWP()));
14 System::Console::WriteLine(ra->Get<double>(Asn::BCWS()));
15 }
16}