Configure MS Project XLSX Options in Aspose.Tasks for .NET

Introduction

Microsoft Project (MS Project) is a powerful tool for project management, and Aspose.Tasks for .NET provides seamless integration for working with MS Project files programmatically. In this tutorial, we’ll walk through the process of configuring MS Project XLSX options using Aspose.Tasks for .NET.

Prerequisites

Before we begin, ensure you have the following:

1. Aspose.Tasks for .NET Installed

Make sure you have Aspose.Tasks for .NET installed in your development environment. If not, you can download it from the Aspose.Tasks for .NET download page.

2. Basic Understanding of C# and .NET Framework

Familiarity with C# programming language and the .NET framework is required to follow along with this tutorial.

3. Microsoft Project File

Have a Microsoft Project file (MPP) ready that you want to configure and save as an XLSX file.

Importing Namespaces

To begin, import the necessary namespaces:

    using Aspose.Tasks;
    using System.Text;
    
    using Aspose.Tasks.Saving;
    using Aspose.Tasks.Visualization;

Step 1: Load the Project

var project = new Project("YourProjectFile.mpp");

Load the Microsoft Project file you want to configure.

Step 2: Define XlsxOptions

var options = new XlsxOptions();

Create an instance of XlsxOptions to configure settings for saving as XLSX.

Step 3: Add Gantt Chart Columns

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

Add desired Gantt Chart columns to the options.

Step 4: Add Resource View Columns

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

Include desired columns for the resource view in the options.

Step 5: Add Assignment View Columns

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

Add desired columns for the assignment view in the options.

Step 6: Set Encoding

options.Encoding = Encoding.Unicode;

Set the encoding for the output file.

Step 7: Save the Project as XLSX

project.Save("OutputFile.xlsx", options);

Save the project with the configured options as an XLSX file.

Conclusion

In this tutorial, we’ve learned how to configure MS Project XLSX options using Aspose.Tasks for .NET. By following these steps, you can customize the output format according to your requirements, enhancing the flexibility and usability of your project management workflow.

FAQ’s

Q: Can I configure different columns for the Gantt Chart, Resource View, and Assignment View separately?

A: Yes, you can customize columns independently for each view using Aspose.Tasks for .NET.

Q: Is there a trial version available before purchasing Aspose.Tasks for .NET?

A: Yes, you can download a free trial from the Aspose.Tasks for .NET releases page.

Q: How can I get support if I encounter any issues or have questions during implementation?

A: You can visit the Aspose.Tasks forum for assistance from the community and Aspose support team.

Q: Can I generate XLSX files with Aspose.Tasks for .NET on non-Windows platforms?

A: Aspose.Tasks for .NET is primarily designed for Windows platforms, but you may explore compatibility options for other platforms.

Q: Are there any temporary license options available for testing purposes?

A: Yes, you can obtain a temporary license from the Aspose.Tasks temporary license page.