Skip to content

Commit 547412a

Browse files
Updated project file operations examples
1 parent 09064e0 commit 547412a

File tree

19 files changed

+1009
-1023
lines changed

19 files changed

+1009
-1023
lines changed

content/english/java/project-file-operations/_index.md

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,34 @@ url: /java/project-file-operations/
1010

1111
## Project File Operations Tutorials
1212
### [Reducing Gap Between Tasks List and Footer in Aspose.Tasks](./reduce-gap-tasks-list-footer/)
13-
### [Render Data with Format 24bppRgb in Aspose.Tasks](./render-data-format-24bppRgb/)
14-
### [Replace Calendar in Aspose.Tasks](./replace-calendar/)
15-
### [Reschedule Project from Start or Finish Date in Aspose.Tasks](./reschedule-project/)
16-
### [Retrieve Calendar Info in Aspose.Tasks](./retrieve-calendar-info/)
17-
### [Retrieve Outline Codes in Aspose.Tasks](./retrieve-outline-codes/)
13+
Learn how to reduce the gap between MS Project task lists and footers using Aspose.Tasks for Java. Optimize project document layout effortlessly.
14+
### [Render MS Project Data with Format 24bppRgb in Aspose.Tasks](./render-data-format-24bppRgb/)
15+
Learn how to render MS Project data as images in Java using Aspose.Tasks. Follow our step-by-step tutorial for seamless integration.
16+
### [Replace MS Project Calendar in Aspose.Tasks](./replace-calendar/)
17+
Learn how to replace Microsoft Project calendar using Aspose.Tasks for Java. Step-by-step guide with code examples.
18+
### [Retrieve MS Project Calendar Info in Aspose.Tasks](./retrieve-calendar-info/)
19+
Learn how to retrieve MS Project calendar info using Aspose.Tasks for Java. Step-by-step guide for accessing calendar details programmatically.
20+
### [Retrieve MS Project Outline Codes in Aspose.Tasks](./retrieve-outline-codes/)
21+
Learn how to retrieve Microsoft Project outline codes programmatically using Aspose.Tasks for Java. Enhance your project management capabilities.
1822
### [Save As CSV, Text, and Template in Aspose.Tasks](./save-csv-text-template/)
23+
Learn how to save Microsoft Project files in CSV, Text, and Template formats using Aspose.Tasks for Java.
1924
### [Save As PDF in Aspose.Tasks](./save-as-pdf/)
20-
### [Save As SVG in Aspose.Tasks](./save-as-svg/)
21-
### [Save Data to Excel in Aspose.Tasks](./save-data-to-excel/)
22-
### [Save Project As JPEG in Aspose.Tasks](./save-as-jpeg/)
23-
### [Set Attributes for New Tasks in Aspose.Tasks](./set-attributes-new-tasks/)
24-
### [Set Time Scale Count in Aspose.Tasks](./set-time-scale-count/)
25-
### [Update Project and Reschedule Uncompleted Work in Aspose.Tasks](./update-project-reschedule-work/)
26-
### [Custom Views in Aspose.Tasks](./custom-views/)
25+
Learn how to convert project files to PDF using Aspose.Tasks for Java. Simple steps for efficient conversion.
26+
### [Convert MS Project to SVG in Java](./save-as-svg/)
27+
Learn how to save Microsoft Project files as SVG in Java using Aspose.Tasks library. Step-by-step guide with code examples.
28+
### [Save MS Project Data to Excel in Aspose.Tasks](./save-data-to-excel/)
29+
Learn how to save Microsoft Project data to Excel files using Aspose.Tasks for Java. Easy integration for Java developers.
30+
### [Convert MS Project As JPEG in Aspose.Tasks](./save-as-jpeg/)
31+
Learn how to easily convert Microsoft Project files to JPEG images using Aspose.Tasks for Java. Boost your productivity.
32+
### [Setting MS Project Attributes for New Tasks in Aspose.Tasks](./set-attributes-new-tasks/)
33+
Learn how to set MS Project attributes for new tasks using Aspose.Tasks for Java. Customize task properties effortlessly with this comprehensive guide.
34+
### [Mastering MS Project Time Scale Count in Aspose.Tasks](./set-time-scale-count/)
35+
Learn how to effectively manage time scale count in MS Project using Aspose.Tasks for Java. Optimize project visualization and management effortlessly.
36+
### [Update & Reschedule MS Project in Aspose.Tasks](./update-project-reschedule-work/)
37+
Learn how to update and reschedule MS Project files programmatically using Aspose.Tasks for Java.
38+
### [Create Custom MS Project Views in Aspose.Tasks](./custom-views/)
39+
Learn how to create custom MS Project views effortlessly using Aspose.Tasks for Java. Enhance project management efficiency with tailored views.
2740
### [Weekday Properties in Aspose.Tasks](./weekday-properties/)
28-
### [Work with Project Server in Aspose.Tasks](./work-with-project-server/)
29-
### [Write MPP Project Summary in Aspose.Tasks](./write-mpp-project-summary/)
41+
Learn to manage weekday properties efficiently in Aspose.Tasks for Java. Customize week start dates, days per month, and more with ease.
42+
### [Write MPP Project Summary in Aspose.Tasks](./write-mpp-project-summary/)
43+
Learn how to write MPP project summaries in Java using Aspose.Tasks. Set and retrieve project information effortlessly.
Lines changed: 71 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
---
2-
title: Custom Views in Aspose.Tasks
2+
title: Create Custom MS Project Views in Aspose.Tasks
33
linktitle: Custom Views in Aspose.Tasks
44
second_title: Aspose.Tasks Java API
5-
description:
5+
description: Learn how to create custom MS Project views effortlessly using Aspose.Tasks for Java. Enhance project management efficiency with tailored views.
66
type: docs
77
weight: 24
88
url: /java/project-file-operations/custom-views/
99
---
10-
11-
## Complete Source Code
10+
## Introduction
11+
In project management, customizing views can significantly enhance the clarity and efficiency of managing tasks and resources. Aspose.Tasks for Java provides powerful tools to create custom views tailored to specific project requirements. In this tutorial, we'll explore how to create custom MS Project views using Aspose.Tasks for Java, step by step.
12+
## Prerequisites
13+
Before we begin, ensure you have the following prerequisites:
14+
### Java Development Environment
15+
Make sure you have Java installed on your system.
16+
### Aspose.Tasks for Java
17+
Download and install Aspose.Tasks for Java from [here](https://releases.aspose.com/tasks/java/).
18+
## Import Packages
19+
First, import the necessary packages to your Java project:
1220
```java
13-
14-
1521
import com.aspose.tasks.Field;
1622
import com.aspose.tasks.GanttChartView;
1723
import com.aspose.tasks.HorizontalStringAlignment;
@@ -20,93 +26,63 @@ import com.aspose.tasks.Prj;
2026
import com.aspose.tasks.Project;
2127
import com.aspose.tasks.TableField;
2228
import com.aspose.tasks.View;
23-
24-
25-
public class Views {
26-
public static void main(String[] args) {
27-
// The path to the documents directory.
28-
String dataDir = "Your Data Directory";
29-
30-
modifyViewAddColumn(dataDir);
31-
32-
workWithView(dataDir);
33-
34-
// Display result of conversion.
35-
System.out.println("Process completed Successfully");
36-
}
37-
38-
public static void modifyViewAddColumn(String dataDir)
39-
{
40-
// Shows how to work with Project's view and add column to the default view (which is shown when MPP file is opened in MS Project).
41-
42-
// Create an empty project without views
43-
Project project = new Project();
44-
project.set(Prj.NAME, "Test View Project");
45-
46-
// Modify the default view (it's a Gantt chart view).
47-
// Or you can select view by name or by View Screen using project.View collection.
48-
GanttChartView view = (GanttChartView) project.getDefaultView();
49-
50-
TableField newColumn = new TableField();
51-
newColumn.setAlignData(HorizontalStringAlignment.Center);
52-
newColumn.setTitle("My new column");
53-
newColumn.setWidth(30);
54-
newColumn.setField(Field.TaskActualDuration);
55-
56-
view.getTable().getTableFields().add(newColumn);
57-
58-
// WriteViewData flag should be used to persist modifications of view's properties.
59-
MPPSaveOptions options = new MPPSaveOptions();
60-
options.setWriteViewData(true);
61-
project.save(dataDir + "modifyView_output.mpp", options);
62-
}
63-
64-
public static void workWithView(String dataDir)
65-
{
66-
// Shows how to work with MS Project views.
67-
68-
// Create an empty project without views
69-
Project project = new Project();
70-
project.set(Prj.NAME, "Test View Project");
71-
72-
// Create a standard Gantt chart view
73-
View view = new GanttChartView();
74-
75-
// Set some view properties
76-
// Set a value indicating whether Microsoft Project shows the single view name in the View or the Other Views drop-down lists in the Ribbon
77-
view.setShowInMenu(true);
78-
// Set a value indicating whether Microsoft Project highlights the filter for a single view
79-
view.setHighlightFilter(true);
80-
81-
// The writing of the next properties is not supported
82-
// Sets the filter used in a single view
83-
view.setFilter(null);
84-
// Sets the group of the single view
85-
view.setGroup(null);
86-
// Sets the table of the single view
87-
view.setTable(null);
88-
89-
// Let's tune some view settings
90-
// Set the number of first columns to be printed on all pages
91-
view.getPageInfo().getPageViewSettings().setFirstColumnsCount(4);
92-
// Set a value indicating whether to print a specified number of first columns on all pages
93-
view.getPageInfo().getPageViewSettings().setPrintFirstColumnsCountOnAllPages(true);
94-
95-
// Add the view to our project
96-
project.getViews().add(view);
97-
98-
// WriteViewData flag should be used to persist modifications of project.Views.
99-
MPPSaveOptions options = new MPPSaveOptions();
100-
options.setWriteViewData(true);
101-
project.save(dataDir + "workWithView_output.mpp", options);
102-
// Let's check some properties of the newly added view
103-
// Print the unique identifier of a view
104-
System.out.println("View Uid: " + view.getUid());
105-
// Print the screen type for the single view
106-
System.out.println("View Screen: " + view.getScreen());
107-
System.out.println("View Type: " + view.getType());
108-
System.out.println("Parent Project of the view: " + view.getParentProject().get(Prj.NAME));
109-
}
110-
}
111-
11229
```
30+
Now, let's break down the example into multiple steps:
31+
## Step 1: Set Up Project
32+
```java
33+
// The path to the documents directory.
34+
String dataDir = "Your Data Directory";
35+
// Create an empty project without views
36+
Project project = new Project();
37+
project.set(Prj.NAME, "Test View Project");
38+
```
39+
## Step 2: Create View
40+
```java
41+
// Create a standard Gantt chart view
42+
View view = new GanttChartView();
43+
```
44+
## Step 3: Customize View Properties
45+
```java
46+
// Set some view properties
47+
view.setShowInMenu(true); // Indicate whether to show the view in the menu
48+
view.setHighlightFilter(true); // Indicate whether to highlight the filter for the view
49+
```
50+
## Step 4: Tune View Settings
51+
```java
52+
// Tune some view settings
53+
view.getPageInfo().getPageViewSettings().setFirstColumnsCount(4); // Set the number of first columns to print on all pages
54+
view.getPageInfo().getPageViewSettings().setPrintFirstColumnsCountOnAllPages(true); // Indicate whether to print specified number of first columns on all pages
55+
```
56+
## Step 5: Add View to Project
57+
```java
58+
// Add the view to our project
59+
project.getViews().add(view);
60+
```
61+
## Step 6: Save Project
62+
```java
63+
// Save the project with the created view
64+
MPPSaveOptions options = new MPPSaveOptions();
65+
options.setWriteViewData(true); // Use WriteViewData flag to persist modifications of project.Views
66+
project.save(dataDir + "workWithView_output.mpp", options);
67+
```
68+
## Step 7: Check View Properties
69+
```java
70+
// Check properties of the newly added view
71+
System.out.println("View Uid: " + view.getUid()); // Print the unique identifier of the view
72+
System.out.println("View Screen: " + view.getScreen()); // Print the screen type for the view
73+
System.out.println("View Type: " + view.getType()); // Print the type of the view
74+
System.out.println("Parent Project of the view: " + view.getParentProject().get(Prj.NAME)); // Print the parent project of the view
75+
```
76+
## Conclusion
77+
Custom MS Project views offer a flexible way to visualize project data according to specific needs. With Aspose.Tasks for Java, creating custom views becomes straightforward, allowing project managers to streamline their workflows effectively.
78+
## Frequently Asked Questions
79+
### Q1: Can I customize views beyond Gantt charts?
80+
A: Yes, Aspose.Tasks for Java provides flexibility to customize various types of views beyond Gantt charts, including tables and graphs.
81+
### Q2: Is Aspose.Tasks for Java suitable for large-scale projects?
82+
A: Absolutely. Aspose.Tasks for Java is designed to handle projects of all sizes, offering robust features for efficient project management.
83+
### Q3: Does Aspose.Tasks for Java support exporting views to different formats?
84+
A: Yes, Aspose.Tasks for Java supports exporting views to various formats such as PDF, XLSX, and HTML, ensuring compatibility with different platforms.
85+
### Q4: Can I automate the creation of custom views using Aspose.Tasks for Java?
86+
A: Certainly. Aspose.Tasks for Java provides comprehensive APIs for automation, enabling developers to programmatically create and manage custom views as needed.
87+
### Q5: Is there a community forum for Aspose.Tasks for Java support?
88+
A: Yes, you can find assistance and engage with other users in the [Aspose.Tasks forum](https://forum.aspose.com/c/tasks/15) for Java-related queries and discussions.

content/english/java/project-file-operations/reduce-gap-tasks-list-footer/_index.md

Lines changed: 81 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,21 @@
22
title: Reducing Gap Between Tasks List and Footer in Aspose.Tasks
33
linktitle: Reducing Gap Between Tasks List and Footer in Aspose.Tasks
44
second_title: Aspose.Tasks Java API
5-
description:
5+
description: Learn how to reduce the gap between MS Project task lists and footers using Aspose.Tasks for Java. Optimize project document layout effortlessly.
66
type: docs
77
weight: 10
88
url: /java/project-file-operations/reduce-gap-tasks-list-footer/
99
---
10+
## Introduction
11+
In this tutorial, we will delve into reducing the gap between the task list and footer in Microsoft Project files using Aspose.Tasks for Java. By following these steps, you'll be able to optimize the layout of your project documents effortlessly.
12+
## Prerequisites
13+
Before we begin, ensure you have the following prerequisites:
14+
1. Java Development Kit (JDK): Make sure you have JDK installed on your system.
15+
2. Aspose.Tasks for Java Library: Download and include the Aspose.Tasks for Java library in your project. You can download it from [here](https://releases.aspose.com/tasks/java/).
1016

11-
## Complete Source Code
17+
## Import Packages
18+
Before diving into the coding part, let's import the necessary packages:
1219
```java
13-
/*
14-
* Copyright 2001-2022 Aspose Pty Ltd. All Rights Reserved.
15-
*
16-
* This file is part of Aspose.Tasks. The source code in this file
17-
* is only intended as a supplement to the documentation, and is provided
18-
* "as is", without warranty of any kind, either expressed or implied.
19-
*/
20-
21-
22-
2320
import com.aspose.tasks.HtmlSaveOptions;
2421
import com.aspose.tasks.ImageSaveOptions;
2522
import com.aspose.tasks.PageSize;
@@ -28,42 +25,83 @@ import com.aspose.tasks.Project;
2825
import com.aspose.tasks.SaveFileFormat;
2926
import com.aspose.tasks.SaveOptions;
3027
import com.aspose.tasks.Timescale;
28+
import java.io.IOException;
29+
```
30+
## Step 1: Provide the Path to Your Data Directory
31+
```java
32+
String dataDir = "Your Data Directory";
33+
```
34+
Make sure to replace `"Your Data Directory"` with the path to your actual data directory where your Microsoft Project file (`HomeMovePlan.mpp` in this example) is located.
35+
## Step 2: Read the MPP File
36+
```java
37+
Project project = new Project(dataDir + "HomeMovePlan.mpp");
38+
```
39+
This line of code reads the Microsoft Project file named `HomeMovePlan.mpp`.
40+
## Step 3: Set ImageSaveOptions
41+
```java
42+
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFileFormat.Png);
43+
imageSaveOptions.setReduceFooterGap(true);
44+
imageSaveOptions.setRenderToSinglePage(false);
45+
imageSaveOptions.setPageSize(PageSize.A0);
46+
imageSaveOptions.setTimescale(Timescale.Days);
47+
```
48+
Configure the image saving options, setting `ReduceFooterGap` to `true` to reduce the gap between the task list and footer.
49+
## Step 4: Save as Image
50+
```java
51+
project.save(dataDir + "ReducingGapBetweenTasksListAndFooter_out.png", (SaveOptions) imageSaveOptions);
52+
```
53+
Save the project as an image with the configured options.
54+
## Step 5: Set PdfSaveOptions
55+
```java
56+
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
57+
pdfSaveOptions.setReduceFooterGap(true);
58+
pdfSaveOptions.setSaveToSeparateFiles(true);
59+
pdfSaveOptions.setPageSize(PageSize.A0);
60+
pdfSaveOptions.setTimescale(Timescale.Days);
61+
```
62+
Define PDF saving options, ensuring to set `ReduceFooterGap` to `true`.
63+
## Step 6: Save as PDF
64+
```java
65+
project.save(dataDir + "ReducingGapBetweenTasksListAndFooter_out.pdf", (SaveOptions) pdfSaveOptions);
66+
```
67+
Save the project as a PDF with the configured options.
68+
## Step 7: Set HtmlSaveOptions
69+
```java
70+
HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions();
71+
htmlSaveOptions.setReduceFooterGap(true); // set to true
72+
htmlSaveOptions.setIncludeProjectNameInPageHeader(false);
73+
htmlSaveOptions.setIncludeProjectNameInTitle(false);
74+
htmlSaveOptions.setPageSize(PageSize.A0);
75+
htmlSaveOptions.setTimescale(Timescale.Days);
76+
```
77+
Specify HTML saving options, setting `ReduceFooterGap` to `true`.
78+
## Step 8: Save as HTML
79+
```java
80+
project.save(dataDir + "ReducingGapBetweenTasksListAndFooter_out.html", htmlSaveOptions);
81+
```
82+
Save the project as an HTML file with the configured options.
3183

84+
## Conclusion
85+
In conclusion, reducing the gap between the task list and footer in Microsoft Project files is a straightforward process with Aspose.Tasks for Java. By following the steps outlined in this tutorial, you can efficiently optimize the layout of your project documents.
3286

33-
import java.io.IOException;
87+
## FAQ's
3488

35-
public class ReducingGapBetweenTasksListAndFooter {
36-
public static void main(String[] args) {
37-
//ExStart: ReducingGapBetweenTasksListAndFooter
38-
String dataDir = "Your Data Directory";
89+
### Q: Is Aspose.Tasks compatible with all versions of Microsoft Project?
3990

40-
//Read the MPP file.
41-
Project project = new Project(dataDir + "HomeMovePlan.mpp");
91+
A: Aspose.Tasks supports Microsoft Project 2003-2019 formats, ensuring compatibility across various versions.
4292

43-
//Use ReduceFooterGap property to reduce the gap between list of tasks and Footer
44-
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFileFormat.Png);
45-
imageSaveOptions.setReduceFooterGap(true);
46-
imageSaveOptions.setRenderToSinglePage(false);
47-
imageSaveOptions.setPageSize(PageSize.A0);
48-
imageSaveOptions.setTimescale(Timescale.Days);
49-
project.save(dataDir + "ReducingGapBetweenTasksListAndFooter_out.png", (SaveOptions) imageSaveOptions);
93+
### Q: Can I customize the appearance of the footer in my project documents?
5094

51-
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
52-
pdfSaveOptions.setReduceFooterGap(true);
53-
pdfSaveOptions.setSaveToSeparateFiles(true);
54-
pdfSaveOptions.setPageSize(PageSize.A0);
55-
pdfSaveOptions.setTimescale(Timescale.Days);
56-
project.save(dataDir + "ReducingGapBetweenTasksListAndFooter_out.pdf", (SaveOptions) pdfSaveOptions);
95+
A: Yes, Aspose.Tasks provides extensive options for customizing the appearance of footers, including reducing gaps and adjusting content placement.
5796

58-
HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions();
59-
htmlSaveOptions.setReduceFooterGap(true); // set to true
60-
htmlSaveOptions.setIncludeProjectNameInPageHeader(false);
61-
htmlSaveOptions.setIncludeProjectNameInTitle(false);
62-
htmlSaveOptions.setPageSize(PageSize.A0);
63-
htmlSaveOptions.setTimescale(Timescale.Days);
64-
project.save(dataDir + "ReducingGapBetweenTasksListAndFooter_out.html", htmlSaveOptions);
65-
//ExEnd: ReducingGapBetweenTasksListAndFooter
66-
}
67-
}
97+
### Q: Does Aspose.Tasks support saving projects in formats other than PNG, PDF, and HTML?
6898

69-
```
99+
A: Yes, Aspose.Tasks supports a wide range of formats, including XLSX, XML, and MPP, among others.
100+
101+
### Q: Is there a trial version available for Aspose.Tasks?
102+
103+
A: Yes, you can download a free trial version of Aspose.Tasks from [here](https://releases.aspose.com/).
104+
105+
### Q: Where can I get support if I encounter any issues while using Aspose.Tasks?
106+
107+
A: You can get assistance from the Aspose.Tasks community forum [here](https://forum.aspose.com/c/tasks/15).

0 commit comments

Comments
 (0)