Set project period to render

There is the possibility that you are required to render a part of the MS Project within the specified time interval. In that case, GroupDocs.Viewer allows rendering part of MS Project document according to specified setStartDate() and setEndDate() properties of ProjectManagementOptions class as shown in code samples below. When only one of these properties is set, rendering starts from the project’s start date or ends on the project’s end date correspondingly.

The following code samples show how to render MS Project document using setStartDate() and setEndDate().

    try (Viewer viewer = new Viewer("sample.mpp")) {
        HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources();
        viewOptions.getProjectManagementOptions().setStartDate(new Date(2008, Calendar.JUNE, 1));
        viewOptions.getProjectManagementOptions().setEndDate(new Date(2008, Calendar.JULY, 1));