Working with Resource Costs

The Resource class is used to manage costs related to a resource:

  • Cost represents a resource’s total project cost across all assignments (decimal).
  • BCWP represents the budgeted cost of work performed by a resource (double).
  • BCWS represents the budgeted cost of scheduled work (doubled).
  • ACWP represents the actual cost of work performed by a resource to date (double).
  • AccrueAt represents the cost accrual method used for a resource (CostAccrualType).

Working with Resource Costs

To view resource costs in Microsoft Project:

  1. On the Resource sheet, from the Insert menu, select Column.
  2. Add the columns.

Getting Resource Costs in 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"ResourceCosts.mpp");
 3    
 4// Display all resources costs
 5    
 6{
 7    auto res_enumerator = (project1->get_Resources())->GetEnumerator();
 8    decltype(res_enumerator->get_Current()) res;
 9    while (res_enumerator->MoveNext() && (res = res_enumerator->get_Current(), true))
10    {
11        if (res->Get<System::String>(Rsc::Name()) != nullptr)
12        {
13            System::Console::WriteLine(res->Get<System::Decimal>(Rsc::Cost()));
14            System::Console::WriteLine(res->Get<double>(Rsc::ACWP()));
15            System::Console::WriteLine(res->Get<double>(Rsc::BCWS()));
16            System::Console::WriteLine(res->Get<double>(Rsc::BCWP()));
17        }
18    }
19}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.