Hi
Hi Lars,
Thank you for writing to Aspose Support team.
At present, we could not find any such method to achieve this. We have further requested our product team to share their feedback about this requirement. We’ll inform you here as soon as the information is available about this.
Hi Lars,
You can format the date as shown in the following code sample, but it can’t be localized to the local culture at present. An enhancement ticket with id: TASKS-34120 has been logged in our issue tracking system for consideration by our Product team towards provision of this feature. We’ll notify you here once there is some update available in this regard.
Sample Code:
Project project = new Project(“NewProductDev.mpp”); // test project (attached)
// default view of this test project is Gantt Chart view
GanttChartView view = project.DefaultView as GanttChartView;
// customize labels
// September 23, … for middle tier
view.MiddleTimescaleTier.Label = DateLabel.Week_mmmm_dd;
// M, T, W… for bottom tier
view.BottomTimescaleTier.Label = DateLabel.Day_di;
project.Save(“Day_di.pdf”, SaveFileFormat.PDF);
// Sep 23, … for middle tier
view.MiddleTimescaleTier.Label = DateLabel.Week_mmm_dd;
// Mon, Tue, Wed… for bottom tier
view.BottomTimescaleTier.Label = DateLabel.Day_ddd;
project.Save(“Day_ddd.pdf”, SaveFileFormat.PDF);
// Sep 23, '14 … for middle tier
view.MiddleTimescaleTier.Label = DateLabel.Week_mmm_dd_yyy;
// Monday, Tuesday, Wednesday… for bottom tier
view.BottomTimescaleTier.Label = DateLabel.Day_dddd;
project.Save(“Day_dddd.pdf”, SaveFileFormat.PDF);
Hi again
Hi Lars,
Please try creating new GanttChartView as shown in the following sample code:
Sample Code:
GanttChartView view = new GanttChartView();
project.Views.Add(view);
Yes, that was the first thing I tried. But I get a null reference exception as a result.
at Aspose.Tasks.Project.(String )
at Aspose.Tasks.Project.()
at .()
at …ctor(Project , , SaveOptions )
at .(SaveOptions )
at .(Stream , SaveOptions )
Hi Lars,
Hi Lars,
The issues you have found earlier (filed as TASKS-34126) 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 TASKS-34120) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hi again!
Hi Lars,
Thank you for writing to Aspose support again.
I have checked the documentation and found that date labels will be rendered with CultureInfo.CurrentCulture now. You may give a try to the following sample code and let us know the feedback.
Project project = new Project("Sample.mpp");
// default view of this test project is Gantt Chart view
GanttChartView view = project.DefaultView as GanttChartView;
// customize labels
// September 23, ... for middle tier
view.MiddleTimescaleTier.Label = DateLabel.WeekMmmmDd;
// M, T, W.. for bottom tier
view.BottomTimescaleTier.Label = DateLabel.DayDi;
project.Save(path + "Day_di.pdf", SaveFileFormat.PDF);
// Sep 23, ... for middle tier
view.MiddleTimescaleTier.Label = DateLabel.WeekMmmDd;
// Mon, Tue, Wed.. for bottom tier
view.BottomTimescaleTier.Label = DateLabel.DayDdd;
project.Save(path + "Day_ddd.pdf", SaveFileFormat.PDF);
// Sep 23, '14 ... for middle tier
view.MiddleTimescaleTier.Label = DateLabel.WeekMmmDdYyy;
// Monday, Tuesday, Wednesday.. for bottom tier
view.BottomTimescaleTier.Label = DateLabel.DayDddd;
project.Save(path + "Day_dddd.pdf", SaveFileFormat.PDF);
Hi!
Hi Lars,
Ok, too bad.
Hi Lars,
Thank you for providing feedback.
Regarding the date localization according to the selected CultureInfo, I have logged an investigation ticket to implement this enhancement under Id: TASKS-34380 in our issue tracking system. I shall write here as soon as some feedback is received about this enhancement.
For the second issue where using two different label settings are not effective, please update your following function in the code and test the scenario again.
view.MiddleTimescaleTier.Label = middleLabel;
//THIS LINE IS ADDED
view.MiddleTimescaleTier.Unit = TimescaleUnit.Quarters;
view.BottomTimescaleTier.Label = bottomLabel;
//THIS LINE IS ADDED
view.BottomTimescaleTier.Unit = TimescaleUnit.Months;
var saveOptions = new PdfSaveOptions()
{
PresentationFormat = PresentationFormat.GanttChart,
FitContent = true,
PageSize = PageSize.A4,
LegendOnEachPage = false,
View = GetProjectViewForPdfExport()
};
asposeProject.Save(stream, saveOptions);
}
Adding the units to the tiers makes no difference for me. The two resulting PDF documents are still identical after I updated my test project. I’ve attached this test project.
Hi Lars,
I updated the dll to the 9.1.0 version and now it works as expected. Thank you!