This small topic focuses on how to add Weekdays in MPP using Java by providing details about setting up the environment and using the example code. It covers the information about all required resources that are used to develop this application without any dependence on MS Project or any other MPP managing software to define weekdays in Microsoft Project using Java.
Steps to Add Weekdays inside MPP file using Java
- Establish the development environment to include Aspose.Tasks for Java JAR from the repository manager
- Generate a new MPP file by creating an instance of the Project class
- Instantiate the Calendar class to add a new calendar and weekdays
- Include the working times for the specific half days and add them to the calendar
- Save the MPP project file on the disk
The above steps in Java add weekdays inside MPP file using a very simple API interface. The process will start by loading an existing or creating a new MPP file using the Project class object, which is then followed by adding a new calendar including days of the week will be added using an instance of Calendar class. Finally, you will either save the MPP file on the disk or inside a memory stream by using the SaveFileFormat enumerator.
Code to Define Weekdays in MPP using Java
In the above example, we tend to add weekdays inside MPP file in Java. We will initiate by loading an existing MPP file or adding a new one from scratch. The Calendar class lets you add different types of calendars including night, standard, and 24 hours shifts. You may also set any day to work along with setting the working times for a specific day using the WorkingTime class instance. The Project file can be saved to other formats including MPP, PDF, and XML.
In this article, we have focused on how to define weekdays in MPP file using Java. If you want to learn about converting an MPP to an SVG, follow the article on how to convert MPP to SVG using Java.