Unable to retain chart format (CTS-3090)

Hi,


I notice that while converting MPP to PDF, the format of chart-header is always kept on ‘weekly’ basis irrespective of how it is input file.

MS Project has a ‘Zoom Slider’ in bottom right corner to change this format, but output doesn’t get this effect. Ability of retaining same chart format is very important. Often if the tasks have very long durations, users tend to keep the chart as monthly or 15-day basis, for those kind of Project files weekly based PDF output will look very bad as it will simply have too many pages of chart towards end.

- Is there a way to set the chart format explicitly ?

- Is there a way to read input file’s chart format ?

Thanks,
Rajiv

Hi Rajiv,


We can set the TimeScale as shown in the following sample code:

Project project = new Project(Path.combine(dir, “RenderMe.mpp”));
SaveOptions options = new PdfSaveOptions();
options.setTimescale(Timescale.Months);
options.setView(ProjectView.getDefaultGanttChartView());

I would also like to share that from Aspose.Tasks for Java 7.0.0 version if original file is mpp, then default columns from mpp will be used.


Hi Kashif,


Can you pls respond to my second question also ? I would like to dynamically keep it same as source. How do I do it ?

Thanks,
Rajiv

Hi Rajiv,


We can read the complete input file chart format as demonstrated in the following code:

static void TestGanttchartView()
{
Project project = new Project(“D:/Aspose/RenderMe2010.mpp”); // attached test project
GanttChartView view = (GanttChartView)project.getViews().toList().get(1);
System.out.println("Is Bar Rounding: " + view.getBarRounding());
System.out.println("Show Bar Splits? : " + view.getShowBarSplits());
System.out.println("Show Drawings? : " + view.getShowDrawings());
System.out.println("Roll Up Gantt Bars? " + view.getRollUpGanttBars());
System.out.println("Hide Rollup Bars When Summary Expanded: " + view.getHideRollupBarsWhenSummaryExpanded());
System.out.println(“Bar Size: " + view.getBarSize());
System.out.println(“Bar Style: " + view.getBarStyles().size());
System.out.println(”\n************************ RETREIVING BAR STYLES INFORMATION FROM THE VIEW ");
for (GanttBarStyle barStyle : view.getBarStyles())
{
System.out.println("Name: " + barStyle.getName());
System.out.println("ShowFor: " + barStyle.getShowFor());
System.out.println("Row: " + barStyle.getRow());
System.out.println("From: " + barStyle.getFrom());
System.out.println("To: " + barStyle.getTo());
System.out.println("MiddleShape: " + barStyle.getMiddleShape());
System.out.println("MiddleShapeColor: " + barStyle.getMiddleShapeColor());
System.out.println("StartShape: " + barStyle.getStartShape());
System.out.println("EndShape: " + barStyle.getEndShape());
System.out.println("EndShapeColor: " + barStyle.getEndShapeColor());
}

System.out.println(“Grid Lines Count: " + view.getGridlines().size());
Gridlines gridlines = view.getGridlines().get(0);
System.out.println(”\n
*** RETREIVING GRID LINES PROPERTIES ");
System.out.println("GridLine Type: " + gridlines.getType());
System.out.println("Gridlines Internval: " + gridlines.getInterval());
System.out.println("Gridlines Color: " + gridlines.getNormalColor());
System.out.println("Gridlines NormalPattern: " + gridlines.getNormalPattern());
System.out.println("Gridlines IntervalPattern: " + gridlines.getIntervalPattern());
System.out.println(“Gridlines IntervalColor: " + gridlines.getIntervalColor());

System.out.println(”\n
*** RETREIVING PROGRESS LINES PROPERTIES ");
if(view.getProgressLines() != null)
{
System.out.println("ProgressLInes.BeginAtDate: " + view.getProgressLines().getBeginAtDate());
System.out.println("ProgressLines.isBaselinePlan: " + view.getProgressLines().isBaselinePlan());
System.out.println("ProgressLines.DisplaySelected: " + view.getProgressLines().getDisplaySelected());
System.out.println("ProgressLines.SelectedDates.Count: " + view.getProgressLines().getSelectedDates().size());
System.out.println("ProgressLines.SelectedDates[0]: " + view.getProgressLines().getSelectedDates().get(0));
System.out.println("ProgressLines.SelectedDates[1]: " + view.getProgressLines().getSelectedDates().get(1));
System.out.println("ProgressLines.SelectedDates[2]: " + view.getProgressLines().getSelectedDates().get(2));
System.out.println("ProgressLines.DisplayAtRecurringIntervals: " + view.getProgressLines().getDisplayAtRecurringIntervals());
System.out.println("ProgressLines.RecurringInterval.Interval: " + Interval.Weekly + view.getProgressLines().getRecurringInterval().getInterval());
System.out.println(“ProgressLines.RecurringInterval.WeeklyDays.Count” + view.getProgressLines().getRecurringInterval().getWeeklyDays().size());
System.out.println("Recurring Interval.WeeklyDays: " + view.getProgressLines().getRecurringInterval().getWeeklyDays());
System.out.println("Recurring Interval.DayType.Saturday: " + view.getProgressLines().getRecurringInterval().getWeeklyDays());
System.out.println("Recurring Interval.DayType.Sunday: " + view.getProgressLines().getRecurringInterval().getWeeklyDays());
System.out.println("ProgressLines.ShowDate: " + view.getProgressLines().getShowDate());
System.out.println("ProgressLines.ProgressPointShape: " + view.getProgressLines().getProgressPointShape());
System.out.println("ProgressLines.ProgressPointColor: " + view.getProgressLines().getProgressPointColor());
System.out.println("ProgressLines.LineColor: " + Color.RED + view.getProgressLines().getLineColor());
System.out.println("ProgressLines.LinePattern: " + LinePattern.Solid + view.getProgressLines().getLinePattern());
System.out.println("ProgressLines.OtherProgressPointShape: " + view.getProgressLines().getOtherProgressPointShape());
System.out.println("ProgressLines.OtherProgressPointColor: " + view.getProgressLines().getOtherProgressPointColor());
System.out.println(“ProgressLines.OtherLineColor: " + view.getProgressLines().getOtherLineColor());
}

System.out.println(”\n
*** BOTTOM TIMESCALE IFORMATION ");
System.out.println(“BottomTimescaleTier.Count:” + view.getBottomTimescaleTier().getCount());
System.out.println(“BottomTimescaleTier.Unit:” + TimescaleUnit.Days + view.getBottomTimescaleTier().getUnit());
System.out.println("BottomTimescaleTier.UsesFiscalYear: " + view.getBottomTimescaleTier().getUsesFiscalYear());
System.out.println("BottomTimescaleTier.Alignment: " + StringAlignment.Center + view.getBottomTimescaleTier().getAlignment());
System.out.println(“BottomTimescaleTier.ShowTicks: " + view.getBottomTimescaleTier().getShowTicks());
System.out.println(“BottomTimescaleTier.Label:” + DateLabel.Day_di + view.getBottomTimescaleTier().getLabel());

System.out.println(”\n
****** MIDDLE TIMESCALE IFORMATION ");
System.out.println(“MiddleTimescaleTier.Count:” + view.getMiddleTimescaleTier().getCount());
System.out.println(“MiddleTimescaleTier.Unit:” + TimescaleUnit.Days + view.getMiddleTimescaleTier().getUnit());
System.out.println("MiddleTimescaleTier.UsesFiscalYear: " + view.getMiddleTimescaleTier().getUsesFiscalYear());
System.out.println("MiddleTimescaleTier.Alignment: " + StringAlignment.Center + view.getMiddleTimescaleTier().getAlignment());
System.out.println(“MiddleTimescaleTier.ShowTicks: " + view.getMiddleTimescaleTier().getShowTicks());
System.out.println(“MiddleTimescaleTier.Label:” + DateLabel.Day_di + view.getMiddleTimescaleTier().getLabel());

System.out.println(”\n
****** TOP TIMESCALE IFORMATION ******************”);
System.out.println(“TopTimescaleTier.Unit:” + TimescaleUnit.Days + view.getTopTimescaleTier().getUnit());
System.out.println("TopTimescaleTier.UsesFiscalYear: " + view.getTopTimescaleTier().getUsesFiscalYear());
System.out.println("TopTimescaleTier.Alignment: " + StringAlignment.Center + view.getTopTimescaleTier().getAlignment());
System.out.println("TopTimescaleTier.ShowTicks: " + view.getTopTimescaleTier().getShowTicks());
System.out.println("TopTimescaleTier.Label: " + view.getTopTimescaleTier().getLabel());
}

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

Hi Kashif,


Sorry for delay in getting back, but I am still confused as to how exactly to retain the chart layout as in the source MPP file … e.g. in attached sample, input file has chart layout in monthly format, but output seems to have it weekly.

I went through your above code, but couldn’t exactly find out which specific API I should use out of all these to retain same format as source file dynamically.

Without any explicit code the default output has somewhat improved in 7.0 compared to previous versions, but still there is a significant gap, if we compare different scenarios, we still see many differences between input & output.

Thanks,
Rajiv

Hi Rajiv,


Currently reading the source MPP file Timescale information is not available.

I have logged an enhancement ticket for reading the source MPP Timescale information for rendering to PDF as id TASKS-33756 in our issue tracking system. I will write back here once any update is available in this regard.

Hi Kashif,


Can you make this TASKS-33756 ES in AjeshEMC quota (without moving the thread) ?

Thanks,
Rajiv

Hi Rajiv,


I have increased the priority of TASKS-33756 to Enterprise support and have linked the ticket to the AjeshEMC ticket here for your tracking. I would further like to add that our development team has analyzed this requirement but implementation of this feature may not be available in the near future as it involves complexity and some other requirements to be resolved first. We’ll update you here once more information is available here in this regard.


Sure … thanks !

Hi Rajiv,


You are welcome!!!

The issues you have found earlier (filed as TASKS-33756) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.