Questions for notes

I have some questions for notes :

1. I open an exist MPP file by Aspose, if no notes in task, I can write some notes to task, but if it has some data in task, it keeps the old value after update it.
2.How to write a line break to notes? I try to use “\n”, but as if it doesn’t effective.

I update notes as below code:


asTask.set(Tsk.NOTES_TEXT, strBuff.toString());

Hi Zhencheng,


Thank you for contacting Aspose support team.

If we update the project and save it as XML file, the notes are updated, however if we save the project as MPP file, the notes are not updated. This issue is logged under Id: TASKSJAVA-200 for further investigation by the product team. You will be notified once any update is received in this regard.

To save the line break in notes, please use following sample code.

<span style=“font-size: 9pt; font-family: “Courier New”;”>Project projWithNotes = <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”;”>Project(<span style=“font-size:9.0pt;font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;
color:green”>“ProjectWithNotes.mpp”
<span style=“font-size: 9pt; font-family: “Courier New”;”>);

Task tsk = projWithNotes.getRootTask().getChildren().getById(<span style=“font-size:9.0pt;font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;
color:blue”>1<span style=“font-size: 9pt; font-family: “Courier New”;”>);

System.<span style=“font-size:9.0pt;font-family:“Courier New”;
mso-fareast-font-family:“Times New Roman”;color:#660E7A”>out
<span style=“font-size: 9pt; font-family: “Courier New”;”>.println(<span style=“font-size:9.0pt;font-family:“Courier New”;
mso-fareast-font-family:“Times New Roman”;color:green”>“Notes Text:”
<span style=“font-size: 9pt; font-family: “Courier New”;”>+ tsk.get(Tsk.<span style=“font-size:9.0pt;
font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;color:#660E7A”>NOTES_TEXT
<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”>NOTES_TEXT
<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:green”>“Changing the notes
1
<span style=“font-size:9.0pt;font-family:“Courier New”;
mso-fareast-font-family:“Times New Roman”;color:navy”>\r\n
<span style=“font-size:9.0pt;font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;
color:green”>Changing the notes 2
<span style=“font-size:9.0pt;
font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;color:navy”>\r\n
<span style=“font-size:9.0pt;font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;
color:green”>Changing the notes 3
<span style=“font-size:9.0pt;
font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;color:navy”>\r\n
<span style=“font-size:9.0pt;font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;
color:green”>Changing the notes 4
<span style=“font-size:9.0pt;
font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;color:navy”>\r\n
<span style=“font-size:9.0pt;font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;
color:green”>”
<span style=“font-size: 9pt; font-family: “Courier New”;”>);

projWithNotes.save(<span style=“font-size:9.0pt;font-family:“Courier New”;
mso-fareast-font-family:“Times New Roman”;color:green”>“SavedProjectWithNotesJava.xml”
<span style=“font-size: 9pt; font-family: “Courier New”;”>, SaveFileFormat.<span style=“font-size:9.0pt;
font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;color:#660E7A”>XML
<span style=“font-size: 9pt; font-family: “Courier New”;”>);

kashif.iqbal:
Hi Zhencheng,

Thank you for contacting Aspose support team.

If we update the project and save it as XML file, the notes are updated, however if we save the project as MPP file, the notes are not updated. This issue is logged under Id: TASKSJAVA-200 for further investigation by the product team. You will be notified once any update is received in this regard.

To save the line break in notes, please use following sample code.

Project projWithNotes = new Project("ProjectWithNotes.mpp");
Task tsk = projWithNotes.getRootTask().getChildren().getById(
1);
System.
out.println("Notes Text:" + tsk.get(Tsk.NOTES_TEXT));
tsk.set(Tsk.
NOTES_TEXT, "Changing the notes 1\r\nChanging the notes 2\r\nChanging the notes 3\r\nChanging the notes 4\r\n");
projWithNotes.save(
"SavedProjectWithNotesJava.xml", SaveFileFormat.XML);


Hi Kashif,
I got a new issue about notes, when the notes include "\r\n", the notes will disappear, this will happened on Linux operating system.

One more issue, if I set the notes with Chinese, then the notes will display ??? question mark.

Hi Zhencheng,


We already have one issue logged in our issue tracking system as TASKSNET-695 where the Chinese letters in Notes are converted “?”. The upcoming release of Aspose.Tasks for Java 9.5.0 will contain the fix for this issue. We’ll update you here once there is some update available in this regard.
guozhencheng:
kashif.iqbal:
Hi Zhencheng,

Thank you for contacting Aspose support team.

If we update the project and save it as XML file, the notes are updated, however if we save the project as MPP file, the notes are not updated. This issue is logged under Id: TASKSJAVA-200 for further investigation by the product team. You will be notified once any update is received in this regard.

To save the line break in notes, please use following sample code.

Project projWithNotes = new Project("ProjectWithNotes.mpp");
Task tsk = projWithNotes.getRootTask().getChildren().getById(
1);
System.
out.println("Notes Text:" + tsk.get(Tsk.NOTES_TEXT));
tsk.set(Tsk.
NOTES_TEXT, "Changing the notes 1\r\nChanging the notes 2\r\nChanging the notes 3\r\nChanging the notes 4\r\n");
projWithNotes.save(
"SavedProjectWithNotesJava.xml", SaveFileFormat.XML);


Hi Kashif,
I got a new issue about notes, when the notes include "\r\n", the notes will disappear, this will happened on Linux operating system.

Hi Kashif,
How about this issue?

Hi Zhencheng,

We have tested this issue on Ubuntu and the latest version of the API i.e. Aspose.Tasks for Java 9.4.0 but were not able to observe the problem of empty notes as you have mentioned. The above code was executed for testing the issue. Please check the attached input and output files for your reference and let us know your feedback. Please rename the file to intput.MPP and output to .xml file for correct viewing.





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


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