How to set the task mode value (Manually scheduled / Auto scheduled)

Hi,


Aspose Tasks Java 9.6.0.

Accoding to this page (http://www.aspose.com/docs/display/tasksnet/Task+Data ), the field “Manual” is Read/Write since MSP 2010.

105.ManualR/WN/AN/AR/WR/W
New for MSP 2010 field

This means that we should be able to make a task in “manually scheduled mode” or “Auto-scheduled mode” by calling task.set(Tsk.IS_MANUAL, true) - or false.

The problem is that IS_MANUAL is a Key<NullableBool, Integer>, and it means that the set() method takes an Integer as the parameter, which doesn’t make sense - it should be a boolean.

So how to change a task Mode using Aspose Java?

Thanks,
Etienne.

Hi Etienne,


Thank you for writing to Aspose support team.

You may use following syntax as key is integer and value is nullable boolean. Please give it a try and share the feedback.

<span style=“font-size: 9pt; font-family: “Courier New”;”>tsk.set(Tsk.<span style=“font-size:9.0pt;font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;
color:#660E7A”>IS_MANUAL
<span style=“font-size: 9pt; font-family: “Courier New”;”>, <span style=“font-size:9.0pt;font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;
color:navy”>new
<span style=“font-size: 9pt; font-family: “Courier New”;”>NullableBool(<span style=“font-size:9.0pt;font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;
color:navy”>false
<span style=“font-size: 9pt; font-family: “Courier New”;”>));



Hi Kashif,


It’s not working.

I’ve tried the below code:

Project asProject = new Project(“C:\temp\Project_blank.mpp”);

asProject.setCalculationMode(CalculationMode.None);

com.aspose.tasks.Task asTask = asProject.getRootTask().getChildren().add(“Task1”);
asTask.set(Tsk.IS_MANUAL, new NullableBool(false));
asTask.set(Tsk.ID, 1);


asProject.save(“c:\temp\output_none.mpp”, SaveFileFormat.MPP);


with both asTask.set(Tsk.IS_MANUAL, new NullableBool(false)); and asTask.set(Tsk.IS_MANUAL, new NullableBool(true)); (as I want my task to be in Manual mode), but in both case the task is in Auto-Scheduled mode in the generated MPP file (same as in the attached files I put in a different thread).

As you can see, I’m using CalculationMode.None.

I think we can merge this thread with the other one that I opened that has all the attachments.

Hi,


Please follow this thread for further discussion in this regard.