Book a Demo

Author Topic: Insert Text - RTF tags remain  (Read 4552 times)

Kaibot

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Insert Text - RTF tags remain
« on: February 08, 2012, 09:15:54 am »
Howdy,

I am running into an issue when attempting to create a document and inserting text with RTF formatting. When setting that text in the Notes section of an element, the formatting is correct but because it is very limited (only bold, italics, underline) things like headings don't appear correctly. (Image below) When I attempt to insert that same text into the document created using the document generator, all the RTF tags remain (<b>, <i>, <u>, <li> and even hyperlink code).

Code:

Code: [Select]

EA.DocumentGenerator docGen = m_Repository.CreateDocumentGenerator();
docGen.NewDocument("");
String text = m_Repository.GetFieldFromFormat("HTML", text); //Take HTML text and convert to EA format
docGen.InsertText(text, "");

//Create file to later
EA.File tmpFile = (EA.File)reqElement.Files.AddNew(reqElement.Name, "RTF");
docGen.SaveDocument(reqElement.Name, EA.DocumentType.dtRTF);

element.Files.Refresh();
element.LoadLinkedDocument(reqElement.Name);

element.Notes = text; //Same text passed into document, appears correct in notes section.

//Update element

Notes section:


On an other note I had found a post a while back where these files were saved to the harddisk. It was not working out for me so I decided to see if I could save it as an EA.File. That seemed to work.

I hope I wasn't too ambiguous. Thanks in advance!
___kai___

Kaibot

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Insert Text - RTF tags remain
« Reply #1 on: February 10, 2012, 06:30:07 am »
Has anyone at least run into this sort of problem?
___kai___

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: Insert Text - RTF tags remain
« Reply #2 on: February 10, 2012, 07:17:04 pm »
Howdy!

I am guessing that the notes field does not accept formatting for headings; if you look at the notes editor in EA there is no facility to add heading information.

Using V12

Kaibot

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Insert Text - RTF tags remain
« Reply #3 on: February 11, 2012, 04:02:49 am »
Quote
Howdy!

I am guessing that the notes field does not accept formatting for headings; if you look at the notes editor in EA there is no facility to add heading information.


Correct, that is the impetus behind wanting to use Linked Documents. However, all the tags still remain and no formatting is kept when I use the method above.

[highlight]Also, I realized the EA.File that I create in the code actually has no use. I don't remember why I had that there.[/highlight]
___kai___