Working with Resource Assignment Budgets
Contents
[
Hide
Show
]Assignment Budget
The ResourceAssignment class exposes a number of properties for working with an assignment’s budget:
- BudgetCost represents the budgeted cost of resources assignments (decimal).
- BudgetWork represents the budgeted work of resource assignments to date (TimeSpan).
To see assignment budgets in Microsoft Project:
- On the Task Usage page, select the Insert menu and then Column.
- Add columns.
Getting Assignment Budget with Aspose.Tasks
The following code example demonstrates how to get an assignment budget using Aspose.Tasks.
1// Create project instance
2System::SharedPtr<Project> project1 = System::MakeObject<Project>(dataDir + u"ResourceAssignmentBudget.mpp");
3
4// Print assignment budget cost and budget work
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::BudgetCost()));
12 System::Console::WriteLine(System::ObjectExt::ToString(ra->Get<Duration>(Asn::BudgetWork())));
13 }
14}