UsageView

UsageView class

Represent a usage view in a project.

public abstract class UsageView : View

Properties

NameDescription
AlignDetailsData { get; set; }Gets or sets details data alignment.
BottomTimescaleTier { get; set; }Gets or sets settings of view’s bottom timescale tier. TimescaleTier
DisplayDetailsHeaderColumn { get; set; }Gets or sets a value indicating whether to display details header column in the view or not.
DisplayShortDetailHeaderNames { get; set; }Gets or sets a value indicating whether to display short detail header names or not.
Filter { get; set; }Gets or sets a filter used in a single view.
Group { get; set; }Gets or sets a group of the single view.
HighlightFilter { get; set; }Gets or sets a value indicating whether Microsoft Project highlights the filter for a single view.
MiddleTimescaleTier { get; set; }Gets or sets settings of view’s middle timescale tier. TimescaleTier.
Name { get; set; }Gets or sets the name of a View object.
PageInfo { get; }Gets an instance of the PageInfo class. Represents page setup data which is present in mpp file format.
ParentProject { get; }Gets the parent of the View object. Read-only Project.
RepeatDetailsHeaderOnAllRows { get; set; }Gets or sets a value indicating whether to repeat details header on all assignment row or not.
Screen { get; }Gets the screen type for the single view. Read-only ViewScreen.
ShowInMenu { get; set; }Gets or sets a value indicating whether Microsoft Project shows the single view name in the View or the Other Views drop-down lists in the Ribbon.
Table { get; set; }Gets or sets a table of the single view.
TimescaleSizePercentage { get; set; }
TopTimescaleTier { get; set; }Gets or sets settings of view’s top timescale tier. TimescaleTier.
Type { get; }Gets the type of item in the single view, such as tasks or resources. Read-only ItemType.
Uid { get; }Gets the unique identifier of a view.
VisualObjectsPlacements { get; }Gets a collection of objects representing placement and appearance of OleObject in the view.

Methods

NameDescription
CompareTo(View)Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
override Equals(object)Returns a value indicating whether this instance is equal to a specified object.
override GetHashCode()Returns a hash code value for the instance of the Resource class.

Examples

Shows how to render task usage view with details.

var project = new Project(DataDir + "TaskUsageViewWithDetails.mpp");

// get the view
UsageView view = (TaskUsageView)project.DefaultView;

// details header column will not be displayed
view.DisplayDetailsHeaderColumn = false;
view.RepeatDetailsHeaderOnAllRows = false;
view.DisplayShortDetailHeaderNames = false;
view.AlignDetailsData = HorizontalStringAlignment.Near;
project.Save(OutDir + "task usage1_out.pdf", SaveFileFormat.Pdf);

// display details header column
view.DisplayDetailsHeaderColumn = true;

// repeat details header on all assignments rows
view.RepeatDetailsHeaderOnAllRows = true;
view.AlignDetailsData = HorizontalStringAlignment.Far;
project.Save(OutDir + "task usage2_out.pdf", SaveFileFormat.Pdf);

See Also