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.
Resource cost columns in Microsoft Project
Getting Assignment Costs with Aspose.Tasks
The following example shows getting task costs using Aspose.Tasks.
1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
2// The path to the documents directory.
3String dataDir = Utils.getDataDir(AssignmentCost.class);
4
5Project project = new Project(dataDir + "EarnedValues2010.mpp");
6
7for (int i = 0; i < project.getResourceAssignments().getCount(); i++) {
8 ResourceAssignment ra = project.getResourceAssignments().getByUid(0);
9 System.out.println(ra.get(Asn.COST));
10 System.out.println(ra.get(Asn.ACWP));
11 System.out.println(ra.get(Asn.BCWP));
12 System.out.println(ra.get(Asn.BCWS));
13}