Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: lynch80516 on March 02, 2020, 03:49:39 am

Title: Document Generation issue with using & in the model
Post by: lynch80516 on March 02, 2020, 03:49:39 am
I have element names and notes that contain & in the description link in a Acronym like TT&C, R&D, etc. However, when crating a document through a template it comes out as TT&ampC, R &amp D, etc. Is there a way to "escape" the & so it comes out correctly?

Thanks,

John
Title: Re: Document Generation issue with using & in the model
Post by: Geert Bellekens on March 02, 2020, 03:49:49 pm
What kind of template did you use?

The regular template should translate these xml escaped characters. (in v15 or higher I think)
If you are using an SQL or script fragment you should indicate that it is a formatted field.

Geert
Title: Re: Document Generation issue with using & in the model
Post by: lynch80516 on March 02, 2020, 05:00:28 pm
It is using a sql query via a fragment. I’m not familiar with a formatted field

John
Title: Re: Document Generation issue with using & in the model
Post by: Geert Bellekens on March 02, 2020, 06:00:03 pm
See the help here:
https://www.sparxsystems.com/enterprise_architect_user_guide/15.1/model_publishing/custom_sql_fragments.html (https://www.sparxsystems.com/enterprise_architect_user_guide/15.1/model_publishing/custom_sql_fragments.html)
Quote
It is possible to force a field to be processed as a hyperlink or as formatted notes, by providing a column in this format:

    custom >

     {Name}

     <fieldname>.Formatted      (or <fieldname>.Hyperlink)       (for all repositories, excluding .eap)

     < custom

In your custom SQL Query statement, you must use an alias matching the template field name; for example (in MySQL):

     SELECT ea_guid AS CLASSGUID, Object_Type AS CLASSTYPE, Name, Note as "Note.Formatted" FROM t_object

     Where Object_ID=#OBJECTID#

For SQL Server I use
Code: [Select]
Note as [Note-Formatted]In my queries.

Geert