The MPP is one of the primary formats of Microsoft Project often utilized to store workloads, schedules, and finances. Since the early release of the Microsoft Project in 1984, it is being used to manage projects, develop schedules, set budgets, and allocate resources. Therefore, MPP format is the native file type associated with Microsoft Project and stores project information when saving a project. Similarly, the XER file format is a proprietary project file format used by the Primavera P6 project planning and management application. So in case, there is a requirement to convert the MPP files to another format, we need to either install and configure an on-premises solution or opt for a cloud-based solution. However, the Aspose Cloud solutions are much optimized and easy to use.
Microsoft Project processing API
Microsoft Project and Primavera P6 are among the popular file formats used for project assignments, tasks, resources, calendars, attributes, & scheduling information. In order to facilitate our customers to programmatically process these documents, we have developed Aspose.Tasks Cloud API which is a REST-based solution enabling you to get project assignment items, add new assignments to projects, get all tasks of a project, change task position, add a calendar to project, get time-scaled data, and much more. Perform all these operations without installing any third-party software.
Furthermore, we have developed Aspose.Tasks Cloud SDK for .NET which is a wrapper around Aspose.Tasks Cloud and enable you to implement all project management-related tasks within the .NET application.
Installation
In order to use the .NET Cloud SDK, the first step is to install it over the system. It’s available for download over NuGet and GitHub. Please execute the following command in the terminal to install the SDK via NuGet:
nuget install Aspose.Tasks-Cloud
In case you need to install from NuGet Package Manager, please execute the following command:
PM> Install-Package Aspose.Tasks-Cloud
Visual Studio approach
Another approach is the installation directly within Visual Studio:
- Open the Solution Explorer.
- Expand the project and Right-click Packages folder within your solution.
- Select Manage NuGet Packages… option
- Click on the Browse tab and search for “Aspose.Tasks-Cloud“.
- Click the checkbox besides Aspose.Tasks-Cloud package, select the appropriate version in the right-tab and click Add Package button.
Free Cloud subscription
In order to access the Cloud APIs, we need to first create a free cloud subscription account. Yes, you have heard it right. A free subscription account providing up to 150 Free document processing requests. No credit card or other payment details are required. So in order to complete this process, please visit Aspose.Cloud dashboard. If you have GitHub or Google account, simply Sign Up. Otherwise, click on the Create a new Account button and provide the required information. Now login to the dashboard using credentials and expand the Applications section from the dashboard and scroll down towards the Client Credentials section to see Client ID and Client Secret details.
MPP to XER in C#
Please follow the steps given below to perform the MPP file conversion to the Primavera P6 XER in C# .NET application.
- First of all, create a Configuration object while providing Client ID and Client Secret details
- Secondly, create an object of TasksApi while passing Configuration object as an argument
- Thirdly, read MPP file from local drive and upload to cloud storage using UploadFile(..) method of TasksApi
- Now create an object of GetTaskDocumentWithFormatRequest where we define input MPP name and resultant format from ProjectFileFormat enumeration
- Then we call the GetTaskDocumentWithFormat(…) method of TasksApi to initiate the conversion process
- Finally, in order. to save the output XER on local drive, we use File.Create object inside saveToDisk(…) method
Convert MPP to Primavera P6 using cURL
The cURL commands are another convenient way of accessing REST APIs through command line terminal. So, we can also access Aspose.Tasks Cloud via cURL commands and accomplish our requirements. However, before accessing the APIs, we need to generate a JSON Web Token (JWT) based on ClientID and ClientSecret details retrieved from Aspose.Cloud dashboard. Please execute the following command in the terminal to generate the JWT token.
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=4ccf1790-accc-41e9-8d18-a78dbb2ed1aa&client_secret=caac6e3d4a4724b2feb53f4e460eade3" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
Once the JWT token has been generated, please execute the following command to convert MPP file available in Cloud storage to XER format.
curl -X GET "https://api.aspose.cloud/v3.0/tasks/Home%20move%20plan.mpp/format?format=xer&returnAsZipArchive=false" \
-H "accept: multipart/form-data" \
-H "authorization: Bearer <JWT Token>" \
-o Converted.xer
The sample file used. inabove example can be downloaded from Home move plan.mpp.
Conclusion
In this article, we have discussed the steps on how to convert Microsoft Project (MPP) file to Oracle Primavera P6 XER file using C# .NET code snippet as well as using the cURL command. Furthermore, the licensing mechanism has been so flexibly designed that you only pay for the interval you have utilized our services. Also, under free account subscription, you are eligible for up to 150 Free document processing requests. So once you are satisfied with the API, you may consider opting for a license purchase which is quite flexible. You are only charged for the requests you have made to the server and it can be as low as $0.005 / API Call. You may visit the pricing page for further details.
Nevertheless, our Cloud SDKS are developed under MIT License, so their complete code snippet can be downloaded from GitHub. In case you encounter any issue while using the API or you have any related query, please feel free to contact via Free Support forum.
Related articles
We also recommend visiting following links to learn more about