Book a Demo

Author Topic: Note rendering in RTF reports  (Read 3416 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Note rendering in RTF reports
« on: April 18, 2013, 02:26:15 am »
Hi all!


I'm working on some RTF templates in 10.0.1006 and am bumping into an issue: Element Notes are generated with the formatting codes (<ul>, <li>, etc) as part of the text.

This occurs when I output the notes to a table column using a template fragment with an SQL query.

The same element notes are rendered correctly when output to regular text in the calling (non-fragment) template.

Is there an option I need to set?
Alternatively, is this a known problem?


Cheers,

/Uffe
My theories are always correct, just apply them to the right reality.

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Note rendering in RTF reports
« Reply #1 on: April 25, 2013, 04:00:19 pm »
This is a limitation with the SQL Template Fragments - not the script Template Fragments. Where the notes are HTML formatted - SQL does not support a command to unformat these.

In this case you may be better off using the non-SQL Custom Query Template Fragment (or using the Automation Interface and scripting to run such a report).

The Automation Interface does support the routines: GetFieldFromFormat() & GetFormatFromField() for swapping formatting. This can be used in Template script.
See:
http://www.sparxsystems.com/enterprise_architect_user_guide/9.3/automation/document_generator_interface.html

& GetFieldFromFormat() & GetFormatFromField() on:
http://www.sparxsystems.com/enterprise_architect_user_guide/9.3/automation/repository3.html
« Last Edit: April 25, 2013, 04:04:43 pm by Dermot »

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Note rendering in RTF reports
« Reply #2 on: April 26, 2013, 06:40:16 pm »
OK, thanks.

For reference, I wrote a JScript to retrieve the information, based on the sample script in the help file.

I did not use GetFieldFromFormat() or GetFormatFromField(); instead I used formatted="1" in the tags.

XML DOM CreateElement balks at creating a tag whose name contains spaces, so I had to do a replace on the completed XML string.

If anyone has a neater way of doing it, I'm listening. :)


/Uffe
My theories are always correct, just apply them to the right reality.