Saving Gantt chart of .mpp file in JPG format except tasks list

Hi,

I have project file and my requirement is to save gantt chart in jpg format without having task detail in left panel, only gantt chart need to print.
please find the attachment for more clarification.

Hi Vibhor,

Thank you for contacting Aspose support team.

Aspose.Tasks can be used to save project file in different formats. There is no direct method to print Gantt chart only similar to Microsoft Project. However following code can be used to remove all the columns in the task sheet. Please give it a try and share your feedback with us.

Project project = new Project(“Sample.mpp”);
project.DefaultView.Table.TableFields.Clear();
project.Save(“output.jpg”, SaveFileFormat.JPEG);

Hi,


Thanks for reply,

But there is some problem while i am using your code.There are two different output i am getting after using “project.DefaultView.Table.TableFields.Clear();” there is no gantt chart for given project file.

1. By using this code:-
Project project = new Project(@“E:\b4ubuild_sample_07.mpp”);

// Save to one page image (Timescale.ThirdsOfMonths)
Aspose.Tasks.Saving.ImageSaveOptions options = new Aspose.Tasks.Saving.ImageSaveOptions(SaveFileFormat.JPEG);
options.Timescale = Timescale.Days;
options.PresentationFormat = PresentationFormat.GanttChart;
project.Save(“NewProductDevThirdsOfMonths.jpeg”, options);
output :- NewProductDevMonths.png (first image)

2.By using your given code:-
Project project = new Project(@"E:\b4ubuild_sample_07.mpp");

// Save to one page image (Timescale.ThirdsOfMonths)
Aspose.Tasks.Saving.ImageSaveOptions options = new Aspose.Tasks.Saving.ImageSaveOptions(SaveFileFormat.JPEG);
options.Timescale = Timescale.Days;
//options.StartDate = new DateTime(2009, 06, 01);
//options.EndDate = new DateTime(2009, 07, 30);
options.PresentationFormat = PresentationFormat.GanttChart;
project.DefaultView.Table.TableFields.Clear();
project.Save("NewProductDevThirdsOfMonths.jpeg", options);
output :- ChartWithout Data.png (second image)


And also if i am applying "startdate","endDate" it also give me a blank chart.


Hi Vibhor,

Thank you for providing feedback.

You may please modify the code such that only one field is left. It displays the task id and complete Gantt Chart. I am afraid no option is found which can display only Gantt chart without displaying any field.

string path = url + “Tasks_737802\”;
Project project = new Project(@"E:\b4ubuild_sample_07.mpp");
ImageSaveOptions options = new ImageSaveOptions(SaveFileFormat.JPEG);
options.Timescale = Timescale.Days;
options.PresentationFormat = PresentationFormat.GanttChart;
TableField field = project.DefaultView.Table.TableFields[0];
project.DefaultView.Table.TableFields.Clear();
project.DefaultView.Table.TableFields.Add(field);
project.Save(path + "output.jpeg", options);

Please feel free to writes us back if you have any other query in this regard.

Hi Kashif,


Thanks for your help but one more issue is there,

If i am applying “startDate” and “endDate” options in your code then again blank chart getting in response.
here is follwing code:

options.StartDate = new DateTime(2009, 05, 01);
options.EndDate = new DateTime(2009, 08, 31);


and in attched image you can see “start date” and “finish date” are changed it is showing year as “00” in the place of “2009”.

Hi,


This seems to be issue with the license used in the testing. If license is not used or if the license is expired, all the years are changed to 2000 as shown here. You may please use a valid license or get a temporary license, check the issue again and share the feedback. If issue is not resolved, please send complete code and input files for our testing.

Hi,


Thanks for support,

But here i am using trial version of “.dll” so i don’t think license could be reason for issue.
before buying i need to be sure that this “.dll” file will solve my solution.

Hi Vibhor,


If you want to test Aspose.Tasks without evaluation version limitations, you may please request a 30 Day Temporary License. Please refer to How to get a Temporary License. Test your scenario using the temporary license and share the feedback. If you don’t use temporary or valid license, you will get dates in year 2000.