Inconsistencies between saved project and generated pdf


#1

When generating a pdf of a project file, not all of the project lines are displaying in the generated pdf. I am just using project.Save(stream,SaveFileFormat.PDF).


#2

@davno,

I have observed the information shared by you and request you to please share the source code and Project file along with generated PDF for reference. Please first try using latest Aspose.Tasks for .NET 19.7 on your end as well.


#3

Aspose.Tasks_19.7.zip (204.9 KB)

The .zip contains the same project file saved in 2 different states as well as the generated pdf’s. There are lines missing in the pdf for both.

Code used was just a basic save to pdf:

    private void CreateTestPdf(string sourcePath, string targetPath)
    {
		EnsureLicense();
        var project = new Project(sourcePath);
        project.Save(targetPath, SaveFileFormat.PDF);
    }

#4

@davno,

I have observed the issue shared by you. An issue with ID TASKSNET-3425 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.


#5

Hello @davno.

The task “Task5” is collapsed in project “Project3.1.mpp”, so it’s children are not visible in the resulting PDF.
Thus Aspose.Tasks mimics the behavior of MS Project application which doesn’t print such tasks.


#6

Hi @vasiliysinitsyn
I am not referring to Task 5 being collapsed in one file and expanded in the other file. I am referring to the differences in the renditions as to when the file is opened in MS Project. In these 2 samples there are missing lines (Task 10 and Task 12).
I have attached screen shots showing the pdf rendition and the file opened in MS Project.

project.3.mpp.png (174.7 KB)

project.3.1.mpp.png (130.1 KB)


#7

@davno,

I have updated the information in our issue tracking system and will share the feedback with you as soon as it will be shared. We request for your patience in this regard.


#8

@davno,

We have investigated the issue further on our end. Actually, the attached projects have their TimescaleStart and TimescaleFinish set to 22.07.2019 23.08.2019 0:00:00, so tasks with start\finish outside of this range are skipped. You can render the full project using the following code:

Project project = new Project("Project3.mpp");         
project.Set(Prj.TimescaleStart, DateTime.MinValue);
project.Set(Prj.TimescaleFinish, DateTime.MinValue);            
project.Save("Project3.pdf", SaveFileFormat.PDF);

or by setting the exact dates to render:

Project project2 = new Project(@"Project3.mpp");

var pdfSaveOptions = new PdfSaveOptions()
{                StartDate = new DateTime(2019, 7, 29),                
                 EndDate = new DateTime(2019, 11, 1)           
 };

project2.Save(@"Project3.2.pdf", pdfSaveOptions);

I hope the shared information will be helpful.


#9

Hi @mudassir.fayyaz
Thanks for the reply and further information.
Unfortunately that still doesn’t give me the result I want which is to render the document so it appears the same as when opened using MS Project.

If I change the Timescale dates to MinValue, the spreadsheet part of the project file displays correctly, but then the timeline part of the file displays incorrectly. It displays the full project timeline, not the timeline that is displayed in MS Project. I have included the various different presentation formats that I have tried in the attached zip.

msproject.renditions.zip (653.8 KB)


#10

@davno,

Thank you for your feedback. I have associated the information in our issue tracking system and will share the good news with you as soon as the issue will be addressed.


#11

@davno,

I like to share that in upcoming Aspose.Tasks for .NET 19.11, we have included support where you can now specify a callback and customize list of rendered tasks in Gantt, Task Usage and Task Sheet views.


            Project project = new Project("test.mpp");

            SaveOptions options = new PdfSaveOptions
            {
                Project = project,
                TasksFilter = new CustomTasksFilter()
            };

            private class CustomTasksFilter : ICondition<Task>
            {
                        public bool Check(Task el)
                        {
                            return el.Get(Tsk.IsSummary) == true || el.Get(Tsk.Duration).TimeSpan > TimeSpan.Zero;
                        }
            }

We will share notification with you once Aspose.Tasks for 19.11 will be available.