mpp to excel

Convert MS Project file to Excel in Java.

Microsoft Project (MPP) files are widely used for managing complex projects, but analyzing and sharing project data in MPP format can be challenging, especially for teams that rely on Excel for data processing and reporting. Converting MPP files to Excel (XLSX) provides a more accessible and flexible way to handle project schedules, resource allocation, and timelines. Excel’s structured tabular format allows for better visualization, filtering, and custom calculations.

MPP to Excel Conversion API

GroupDocs.Conversion Cloud SDK for Java provides a seamless and efficient way to convert Microsoft Project (MPP) files to Excel (XLSX) format. This powerful API eliminates the need for manual data extraction by offering an automated solution that ensures data accuracy and consistency. With GroupDocs.Conversion, users can effortlessly transform complex project schedules, resource allocations, and task dependencies into structured Excel spreadsheets for easier analysis and reporting.

Installation

Please add the following details to pom.xml file of maven build project.

<repository>
    <id>repository.groupdocs.cloud</id>
    <name>repository.groupdocs.cloud</name>
    <url>https://releases.groupdocs.cloud/java/repo/</url>
</repository>
<dependency>
    <groupId>com.groupdocs</groupId>
    <artifactId>groupdocs-conversion-cloud</artifactId>
    <version>24.8</version>
</dependency>

Once the installation is completed, please obtain your personalized API credentials(i.e. Client ID and Client Secret). You may visit this short tutorial explaining the details on how to get the API credentials.

Convert MPP to Excel in Java

This section explains the details on how to convert MS Project file to Excel workbook using Java code snippet.

  1. Firstly, create an instance of Configuration class where we pass client credentials as arguments.
Configuration configuration = new Configuration(clientId, clientSecret);
  1. Secondly, initialize the ConvertApi where we pass Configuration object as an argument.
ConvertApi convertApi = new ConvertApi(configuration);
  1. Create an instance of ConvertSettings class where we define the input file name, output format and the name of resultant document.
ConvertSettings settings = new ConvertSettings();
  1. Create an instance of ConvertDocumentRequest class where we pass ConvertSettings object as an argument.
ConvertDocumentRequest request = new ConvertDocumentRequest(settings);
  1. Lastly, call the ConvertDocumentRequest API to convert the MPP to Excel and save the resultant Excel workbook to the cloud storage.
List<StoredConvertedResult> response = convertApi.convertDocument(request);
// More examples over https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-dotnet
// Obtain your API credentials
string clientId = "XXXXXX-XXXXXXXXX-4088-9ca0-55c38f4b7f22";
string clientSecret1 = "XXXXXXXXXXXXXXXXXXXX";
// Create an instance of the Configuration class and initialize it with the Client ID & Client Secret
Configuration configuration = new Configuration(clientId, clientSecret);
// Define the API base URL for MPP to Excel conversion
configuration.setApiBaseUrl("https://api.groupdocs.cloud");
// Initialize an instance of ConvertApi with the Configuration object
ConvertApi convertApi = new ConvertApi(configuration);
ConvertSettings settings = new ConvertSettings();
settings.setStorageName("internal");
settings.setFilePath("Home move plan.mpp");
settings.setFormat("xls");
settings.setOutputPath("converted.xls");
// Invoke the ConvertDocument method to perform MPP to Excel conversion
ConvertDocumentRequest request = new ConvertDocumentRequest(settings);
List<StoredConvertedResult> response = convertApi.convertDocument(request);
// Check the response and print success message
if (response != null && response.equals("OK")) {
System.out.println("The MPP to Excel conversion completed successfully!");
}
view raw mpp-to-xls.java hosted with ❤ by GitHub
mpp to excel

Image:- Preview of MS Project to Excel conversion.

  • The input MS Project file used in the above example can be downloaded from Home move plan.mpp.

Export MS Project to XLSX using cURL Commands

Convert Microsoft Project (MPP) files to Excel (XLSX) seamlessly using GroupDocs.Conversion Cloud API and cURL commands. This cloud-based solution eliminates software dependencies, ensuring fast, secure, and accurate data conversion. With simple REST API requests, you can automate the process, enabling efficient project analysis and reporting.

The first step in this approach is to generate a JWT access token and then, execute the following cURL command to develop Microsoft project viewer online by export MS Project file to PDF format. After successful conversion, the resultant Excel workbook is stored in the cloud storage.

curl -v "https://api.groupdocs.cloud/v2.0/conversion" \
-X POST \
-H "accept: application/json" \
-H "authorization: Bearer {accessToken}" \
-H "Content-Type: application/json" \
-d "{  \"StorageName\": \"default\",  \"FilePath\": \"{inputMPP}\",  \"Format\": \"xls\",  \"OutputPath\": \"{resultantXLS}\"}"

Please replace inputMPP with the name of input MS Project file, resultantXLS with the name of resultant Excel workbook and accessToken with a personalized JWT access token.

  • In case we have a requirement to export the MS project to Excel and save the resultant file on local drive:
curl -v "https://api.groupdocs.cloud/v2.0/conversion" \
-X POST \
-H "accept: application/json" \
-H "authorization: Bearer {accessToken}" \
-H "Content-Type: application/json" \
-d "{  \"StorageName\": \"default\",  \"FilePath\": \"{sourceFile}\",  \"Format\": \"xls\"}" \
-o "output.xls"

MPP to XLS Converter App

We recommend using our free and lightweight MPP to Excel Converter App enables you to explore the unique capabilities of GroupDocs.Conversion Cloud within a web browser.

mpp to xls conversion app

Conclusion

In conclusion, converting MPP to Excel using Java REST API provides a seamless and efficient way to manage project data. Whether you choose GroupDocs.Conversion Cloud SDK for Java or utilize cURL commands, both approaches offer flexibility, automation, and accuracy in data conversion. The cloud-based solution eliminates the need for additional software installations, ensuring secure and scalable conversions. By leveraging these methods, you can enhance project management, streamline reporting, and improve collaboration.

We highly recommend visiting the following links to learn more about: