Customize MS Project Page View Settings in Aspose.Tasks

Introduction

Microsoft Project is a powerful tool for project management, but sometimes you need to customize the way your project is viewed and printed. With Aspose.Tasks for .NET, you can easily configure the page view settings to meet your specific requirements. In this tutorial, we’ll guide you through the process step by step.

Prerequisites

Before we begin, make sure you have the following:

  1. Aspose.Tasks for .NET: Ensure you have downloaded and installed the Aspose.Tasks for .NET library. You can download it from here.
  2. Microsoft Project File: Have a Microsoft Project file ready that you want to configure the page view settings for.

Import Namespaces

First, you need to import the necessary namespaces to work with Aspose.Tasks in your .NET project.

    
    using Aspose.Tasks.Saving;

Step 1: Load the Project File

Start by loading your Microsoft Project file into an instance of the Project class.

// The path to the documents directory.
String DataDir = "Your Document Directory";
var project = new Project(DataDir + "Input.mpp");

Step 2: Set First Columns Count

Specify the number of first columns to be printed on all pages.

project.DefaultView.PageInfo.PageViewSettings.FirstColumnsCount = 2;

Step 3: Print Notes

Choose whether to print notes along with the project.

project.DefaultView.PageInfo.PageViewSettings.PrintNotes = true;

Step 4: Fit Timescale to End of Page

Decide whether to fit the timescale to the end of a page when printing.

project.DefaultView.PageInfo.PageViewSettings.FitTimescaleToEndOfPage = true;

Step 5: Print All Sheet Columns

Specify whether to print all sheet columns of a view.

project.DefaultView.PageInfo.PageViewSettings.PrintAllSheetColumns = true;

Step 6: Print Blank Pages

Choose whether to print blank pages of a view.

project.DefaultView.PageInfo.PageViewSettings.PrintBlankPages = false;

Step 7: Print First Columns on All Pages

Set whether to print a specified number of first columns on all pages.

project.DefaultView.PageInfo.PageViewSettings.PrintFirstColumnsCountOnAllPages = true;

Step 8: Save the Project with Configured Settings

Finally, save the project with the configured page view settings, specifying the output format, such as PDF.

project.Save(DataDir + "ProjectWithComments_out.pdf", SaveFileFormat.Pdf);

Conclusion

Configuring Microsoft Project page view settings in Aspose.Tasks for .NET is straightforward and allows you to tailor the printing format to your exact needs. By following the steps outlined in this tutorial, you can ensure that your project documents are presented exactly as required.

FAQ’s

Q: Can I configure page view settings for other file formats besides PDF?

A: Yes, Aspose.Tasks supports various file formats for saving projects, including XLSX, MPP, and HTML.

Q: Are there any limitations on the number of columns I can print?

A: Aspose.Tasks allows you to customize the number of columns to be printed based on your requirements.

Q: Can I apply different page view settings for different projects?

A: Yes, you can adjust the page view settings independently for each project file you work with.

Q: Is Aspose.Tasks compatible with all versions of Microsoft Project?

A: Aspose.Tasks offers compatibility with Microsoft Project 2003 and later versions.

Q: Where can I find further assistance or support for Aspose.Tasks?

A: You can visit the Aspose.Tasks forum for any inquiries or issues you encounter during usage.