0

I am working on Enterprise Architect C# add-ins to import contents from Excel file to requirement element and exporting the same to Excel.

When Excel contents contains new lines are written to element's notes, no new line is seen and the entire contents are displayed as a straight line.

Yet when the notes of the same element are exported to Excel file, the new lines are correctly displayed. Are there any EA settings for maintaining the new lines in element notes.

Sample excel description:

Test: this is a new sentence 
Note: This is a new note 
Aligning element notes is being tested. 
Naga K.S
  • 13
  • 3

1 Answers1

0

Did you try Environment.Newline or \r\n ? You need to replace the new line contents with either one of this

 EA.Element ele = repository.GetTreeSelectedObject();
 ele.Notes = "111" + Environment.NewLine + "222\r\n333"";
 ele.Update();

Environment.Newline will add a new line and the OP will be like

111

222

333

For more details refer here

Community
  • 1
  • 1
Dah Sra
  • 4,107
  • 3
  • 30
  • 69
  • Thank you. I have updated the answer with sample description. I wont be able to know where are the new lines and spacings while writing it to element notes. Kindly help. – Naga K.S Jun 20 '18 at 13:32