Aspose.Tasks.Examples.CSharp.ConvertingProjectData.UsingXlsxOptions.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {           
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName);

            // ExStart:UsingXlsxOptions
            // Read the input Project file
            Project project = new Project(dataDir + "CreateProject2.mpp");
                                   
            XlsxOptions options = new XlsxOptions();

            // Add desired Gantt Chart columns
            GanttChartColumn col = new GanttChartColumn("WBS", 100, delegate(Task task) { return task.Get(Tsk.WBS); });
            options.View.Columns.Add(col);

            // Add desired resource view columns
            ResourceViewColumn rscCol = new ResourceViewColumn("Cost center", 100, delegate(Resource resource)
            { return resource.Get(Rsc.CostCenter); });
            options.ResourceView.Columns.Add(rscCol);

            // Add desired assignment view columns
            AssignmentViewColumn assnCol = new AssignmentViewColumn("Notes", 200, delegate(ResourceAssignment assignment)
            { return assignment.Get(Asn.Notes); });
            options.AssignmentView.Columns.Add(assnCol);

            project.Save(dataDir + "UsingXlsxOptions_out.xlsx", options);
            // ExEnd:UsingXlsxOptions
        }
    }
UsingXlsxOptions