AssignmentViewColumn.GetColumnText

AssignmentViewColumn.GetColumnText method

Converts current resource assignment to the column text.

public string GetColumnText(ResourceAssignment assignment)
ParameterTypeDescription
assignmentResourceAssignmentCurrent assignment.

Return Value

The column text.

Examples

Shows how to add columns for assignment views.

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

var options = new Spreadsheet2003SaveOptions();

var column = new AssignmentViewColumn("Notes", 200, delegate(ResourceAssignment assignment) { return assignment.Get(Asn.NotesText); });
options.AssignmentView.Columns.Add(column);

foreach (var assignment in project.ResourceAssignments)
{
    foreach (var col in options.AssignmentView.Columns)
    {
        var assnCol = (AssignmentViewColumn)col;
        Console.WriteLine("Column Field: " + assnCol.Field);
        Console.WriteLine("Column Text ( converted ): " + assnCol.GetColumnText(assignment));
        Console.WriteLine();
    }
}

project.Save(OutDir + "UsingSpreadsheet2003SaveOptions_out.xml", options);

See Also