Setting Resource Properties

The Resource class has a number of properties for getting and setting resource attributes:

  • Name gets and sets a resource’s name (string).
  • Id gets and sets a resource’s ID (integer).
  • Uid gets and sets a resource’s UID (integer).
  • Start gets and sets a resource’s start date (java.util.Date).
  • Finish gets and sets a resource’s end date (java.util.Date).

Working with General Resource Properties

To view a resource’s general properties in Microsoft Project:

  1. From the View menu, select More Views and then Resource Sheet.
  2. From the Insert menu, select Column.
  3. Add the Start, Finish, ID and unique ID columns.

General resource properties in Microsoft Project

show general resource properties in Microsoft Project

Setting General Resource Properties using Aspose.Tasks

The following example gives a detailed code sample about setting resource properties.

 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(SetResourceProperties.class);
 4
 5Project project = new Project();
 6Resource rsc = project.getResources().add("Rsc");
 7// Resource properties are represented by static class Rsc
 8
 9// set resource properties
10rsc.set(Rsc.STANDARD_RATE, BigDecimal.valueOf(15));
11rsc.set(Rsc.OVERTIME_RATE, BigDecimal.valueOf(20));
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.