Summary tasks cannot set limit types individually

Hi,
When I exported the plan, I found that if “Should not start before…” is set in the summary task and is not set in the leaf task, the summary task in the exported plan will lose this restriction type and restriction date setting.
This seems to be the summary task following some status of the leaf task. Is this phenomenon correct?

@Jiangqiming ,

you can check the same behavior in MS Project:

  1. Add task ‘Summary’
  2. Set constraint type and constraint date of task ‘Summary’
  3. Add child task for task ‘Summary’

In this case the constraint of task ‘Summary’ is cleared.
Aspose.Tasks implements the same logic.

You can set constraint type and constraint date after all children tasks are added.

The normal scenario seems to be like this, but if you create a summary task first, then add leaf tasks to the summary task, and finally set the restriction type of the summary task, this is also possible.

There is another question that I would like to confirm. How to set the duration format in the plan export. For example, the duration is “1d” by default when exporting. How to set it to “1个工作日” in Chinese?

Yes, the phenomenon is correct. When exporting a plan, if “Should not start before…” is set in the summary task but not in the leaf task, the exported plan loses this restriction type and date for the summary task. This behavior indicates that the summary task inherits its scheduling constraints from the leaf tasks. It’s essential to individually set restrictions for summary and leaf tasks to ensure accurate exportation of plan details.

Thank U very much, and could you help confirm another question? This about how to export Chinese during the construction period

@Jiangqiming ,
do you want to customize duration columns when exported to MPP or to XML format ?

Yes, I’d like to know how I can get the exported duration to no longer have “1d” but “1 working day”.
In fact, we are using it in China, so there will be this demand.
Sorry to disturb you so late

@Jiangqiming ,
could you clarify in which format the project is exported?

Hi
The export format is mpp
The export effect in our current environment is shown in Figure 1.
The effect we expect is shown in Figure 2
That is to say, when selecting the construction period, it does not display “d” but “个工作日”

img_v3_026a_b62c7b0d-1651-4ddb-a112-0a2e2421aeeg.jpg (29.6 KB)

img_v3_026a_18c4c242-807c-4175-8f8c-3b5ba5afa45g.jpg (11.0 KB)

@Jiangqiming ,
usually duration properties are formatted using MS Project’s language settings (Project Options\Language).

Could you check that you haven’t assigned values like “1d” or “2d” to task’s DurationText property.

If DurationText property is set, its value is shown instead of duration value formatted using MS Project’s language settings.

I checked the settings of MS Project. The default language is to follow the system, and my local system is Chinese. And after I switched to the default Chinese, the display is still “1d”.
Later, I checked the DurationText property and found that I had not set it. see picture 1
In fact, this is not the only strange thing. The title of the task name is also in a different language from other column titles. See Figure 2.
img_v3_026f_6a199b7c-72cd-485d-9a18-5432eb5b3f0g.jpg (61.2 KB)
img_v3_026f_73513d2c-3cdb-4d8b-847f-ed784c47c38g.jpg (65.4 KB)

@Jiangqiming ,
can you attach the sample MPP file so we can examine it, please ?

you can check this link, i am already put a fully method in it.

@Jiangqiming ,
I’ve tried the code using my template (empty) MPP file and cannot reproduce the described behavior. Can you share template MPP or resulting MPP file?

OK.
you can download file in this link: https://github.com/jiangdu945/PushWorthGoods/files/13775272/CreateNewTask_out1225095309.zip

and could you paste the mpp pic you tested?

@Jiangqiming,
we need some time to examine the file.

yes:

@Jiangqiming ,

the duration column format is affected by the following project setting:

You can modify your template file using MS Project (open template file using MS Project, change setting and save it).
Another option is to apply the following workwaround and set the DayLabel setting programmatically:

Project project = ... // open template or create new project
...
project.DisplayOptions.DayLabel = (DayLabelDisplay)3; // currently we don't have an enumeration member corresponding to a localized day label.
...
project.Save("output.mpp");

OK,Thanks
But, How to set the default task name title to Chinese when exporting?
I noticed that in the screenshot of your test, the title of the task name is also in English.

@Jiangqiming ,

you can clear corresponding column’s Title property so that MS Project uses localized column title:

var project = new Project();
var view = (GanttChartView)project.DefaultView;
view.Table.TableFields[3].Title = null;
var options = new MPPSaveOptions();
options.WriteViewData = true;
project.Save("output.mpp", options);