This short guide describes how to convert MPP to XLSX using Java. It covers IDE setup, a step-by-step guide, and sample code for converting an MPP to Excel using Java. You will learn to add columns and customize the resulting output Excel file.
Steps to Convert MPP to Excel using Java
- Set the environment to use Aspose.Tasks for Java to change MPP to XLSX
- Apply a license to use the product without any limitations
- Load the source MPP file into memory using the Project class
- Configure the XlsxOptions object to customize the output XLSX file
- Create a few columns in the XLSX first sheet using the GanttChartColumn class
- Instantiate the ResourceViewColumn object to add a custom column in the resource sheet
- Add a notes column in the assignment sheet using the AssignmentViewColumn class
- Save the resultant project as an XLSX file on the disk
The given steps assist in converting Microsoft Project to Excel using Java. The process is commenced by loading the license, loading the source MPP file into memory, creating the XlsxOptions class object, and saving the resultant project file directly as an XLSX file using the default settings. For adding custom columns to different sheets in the output Excel file, you may use GanttChartColumn, ResourceViewColumn, and AssignmentViewColumn as demonstrated in the given sample code.
Code to Convert MS Project to Excel using Java
This code demonstrates how to convert Microsoft Project file to Excel using Java. You may utilize the setEncoding() method in the XlsxOptions for a specific character encoding in the output Excel file. Also, instead of creating the columns from scratch, you may try using the getDefaultTaskSheetView() or getDefaultResourceSheetView() in the ProjectView to access the default collection and extend more columns to this collection.
This short guide has shown the process to transform an MPP file to an XLSX file. To set predecessor tasks in a project file, refer to the article Set predecessor in MS Project using Java.