MPP file

MPP File to Excel Conversion | Convert Microsoft Project File to XLS using Java

In the realm of project management, success hinges on the ability to access, analyze, and act upon your project data effectively. MPP files are the lifeblood of project managers, containing critical information that drives decision-making. However, the need to share, collaborate, and analyze this data often requires a transition from MPP to a more versatile format like Excel. This conversion enables project managers to harness the power of Excel’s data manipulation capabilities, making project data more accessible and actionable.

In this article, we delve into the essential need and undeniable benefits of converting MPP to Excel, using the Java Cloud SDK .

Java REST API for Microsoft Project Files Conversion

Aspose.Tasks Cloud SDK for Java empowers you to seamlessly bridge the gap between MPP files and Excel spreadsheets. Whether you’re managing tasks, timelines, resources, or budgets, this conversion unlocks the potential for efficient data extraction and analysis. It also] provides the capabilities to create, manipulate and export Microsoft Project file to Excel, HTML, JPEG, PDF, XML, PNG formats.

In order to use the SDK, you may directly download aspose-tasks-cloud.jar or add the following reference to pom.xml in the maven build type project.

<repositories>
    <repository>
        <id>aspose-cloud</id>
        <name>artifact.aspose-cloud-releases</name>
        <url>http://artifact.aspose.cloud/repo</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.aspose</groupId>
        <artifactId>aspose-tasks-cloud</artifactId>
        <version>21.10.0</version>
    </dependency>
</dependencies>

Furthermore, the next step to use the SDK is to register an account over Aspose.Cloud dashboard using GitHub or Google account or simply Sign Up to obtain your Client Credentials.

Convert MPP File to Excel in Java

Let’s explore the details on how we can load MPP file from cloud storage and export MS Project to excel in the Java application.

  • First, create an instance of ApiClient class while passing your Client ID and Client Secret as constructor arguments
  • Secondly, create an object of TasksApi which takes the ApiClient object as an argument
  • Thirdly, create an object of UploadFileRequest which takes the name of the input MPP file as an argument
  • Call UploadFile(…) method to upload the MPP file to cloud storage
  • The next step is to instantiate an object of GetTaskDocumentWithFormatRequest where we provide the name of the input MPP file and XLSX as the output format
  • Finally, call the method getTaskDocumentWithFormat(…) to convert the MPP file to Excel and save the output to cloud storage

Export Microsoft Project File to Excel using cURL Commands

In this section, we are going to use cURL commands to export the Microsoft Project File to Excel format. The resultant file is downloaded to the local drive. However, before we initialize the conversion operation, we need to generate a JWT access token based on client credentials. Please execute the following command in the terminal application to generate the JWT token:

curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=bbf94a2c-6d7e-4020-b4d2-b9809741374e&client_secret=1c9379bb7d701c26cc87e741a29987bb" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"

Now that we have the token, please execute the following command to convert the MPP file available in cloud storage to Excel format.

curl -v -X GET "https://api.aspose.cloud/v3.0/tasks/source.mpp/format?format=xlsx&returnAsZipArchive=false" \
-H  "accept: multipart/form-data" \
-H  "authorization: Bearer <JWT Token>" \
-o Converted.xlsx
MPP file to XLS conversion preview

Image 1:- Microsoft Project file to XLSX conversion preview.

The input MPP file used in the above example can be downloaded from Home_move_plan.mpp and the resultant excel can be downloaded from Converted.xlsx.

Conclusion

This article has explained the steps to convert an MPP file to Excel format using Java Cloud SDK. We have noticed that with a single API call, the whole conversion is performed and we have also explored the flexibility to export Microsoft project file to Excel workbook using cURL commands over the command line terminal. Furthermore, the complete source code of SDK is also available over GitHub and you may modify it as per your requirements.

We highly recommend visiting the following links to learn about