Book a Demo

Author Topic: EA 7.1 GetFormatFromField & Rich Text Notes  (Read 6237 times)

TimmyTreeFriends

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
EA 7.1 GetFormatFromField & Rich Text Notes
« on: February 29, 2008, 11:58:50 pm »
Hi guys we have a problem converting EA's element notes into plain text format (don't have tags).

For example, if element.Notes returns:

<ol>
<li>Line1</li>
<li>Line2</li>
</ol>



Repository.GetFormatFromField("TXT", element.Notes) returns:

<br/>
<ol>
<li>Line1</li>
<li>Line2</li>
</ol>

It doesn't look very different from the original element.Notes. :(



and Repository.GetFormatFromField("RTF", element.Notes) returns:

<br/>
<ol>
<li>Line1</li>
<li>Line2</li>
</ol>

The outcome is identical to "TXT", confused....



what's interesting is that Repository.GetFormatFromField("HTML", element.Notes) returns something like:

Quote
{\rtf1\ansi\deflang2057\ftnbj\uc1\deff1
{\fonttbl{\f0 \froman \fcharset0 Times New Roman;}{\f1 \fswiss \fcharset0 Arial;}{\f2 \fnil \fcharset0 Century Gothic;}{\f3 \fmodern \fcharset0 Courier New;}{\f4 \froman \fcharset2 Symbol;}{\f5 \fnil \fcharset2 Wingdings;}}
...........

I saved this output into a txt file and rename the file extension to be ".rtf" and it proved that this is RTF output, instead of HTML.



Do I miss anything here? Or this isn't the proper way to call GetFormatFromField method? Or is it a bug for 7.1 beta 2? Please advice.

Thanks in advance.

Tim

EA's repository reference http://www.sparxsystems.com/EAUserGuide71/index.html?repository3.htm

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: EA 7.1 GetFormatFromField & Rich Text Notes
« Reply #1 on: March 01, 2008, 12:20:08 am »
It looks like a plain old bug.

Seems that they've got the various format parameters switched. You are definitely getting RTF when you want HTML. It also looks like you are getting HTML when you ask for T(e)XT. And RTF seems to be returning HTML as well.

Have you sent a bug report directly to Sparx yet? This should be easy to rectify, since the code can apparently generate HTML and RTF, and hopefully plain text won't be a big problem. With any luck all they need to do is tighten up a case statement somewhere.

David
No, you can't have it!

TimmyTreeFriends

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: EA 7.1 GetFormatFromField & Rich Text Notes
« Reply #2 on: March 01, 2008, 12:29:05 am »
Thanks a lot Midnight, I will do that.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: EA 7.1 GetFormatFromField & Rich Text Notes
« Reply #3 on: March 03, 2008, 12:48:09 pm »
Thanks.

You're right, this is wrong and should be corrected for our next build.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: EA 7.1 GetFormatFromField & Rich Text Notes
« Reply #4 on: March 03, 2008, 12:59:16 pm »
Thanks Simon. I was a bit preemptive there, but it just seemed strange somehow.

David
No, you can't have it!

TimmyTreeFriends

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: EA 7.1 GetFormatFromField & Rich Text Notes
« Reply #5 on: March 03, 2008, 08:37:48 pm »
Thanks a lot Simon.