Sparx Systems Forum

Discussion => Automation Interface, Add-Ins and Tools => Topic started by: andreas.gerber@cte.ch on August 23, 2017, 07:37:47 pm

Title: Document generation with fragment
Post by: andreas.gerber@cte.ch on August 23, 2017, 07:37:47 pm
I have created a document template with an embedded fragment. Within the fragment (template) I am using a custom query to select a specific requirements. From these requirements I want to display some attributes and of of them is the description which is stored in the field t_object.note.
The syntax of the query is like Select o.note as RequirementDescription from t_object o .....where ....
and the alias  RequirementDescription is mapped to the field in the fragment.     
Now I have recognized, that in case of a long description I got not the whole text but only 254 characters.
Is there a way to read the whole content and bring it to the document?

Thanks for your help
Andy
Title: Re: Document generation with fragment
Post by: Geert Bellekens on September 09, 2017, 04:00:08 pm
Check out this page of the manuel:
http://sparxsystems.com/enterprise_architect_user_guide/13.5/model_publishing/custom_sql_fragments.html (http://sparxsystems.com/enterprise_architect_user_guide/13.5/model_publishing/custom_sql_fragments.html)

Somewhere at the bottom of no 5 you'll find:
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#

Geert
Title: Re: Document generation with fragment
Post by: andreas.gerber@cte.ch on November 30, 2017, 03:11:44 am
Hi Geert,
thanks for your help. I tried it out only now, but it didn't works.

1. The query did work only in the format ....Note as [Note-Formatted], a dot "." always returned an error
2. In the custom field on the template I tried different variants, but I only get the 255 characters.

Did you tried it out?
How was your query and how was the exact content of the custom field?

Andy   

Title: Re: Document generation with fragment
Post by: Geert Bellekens on November 30, 2017, 03:59:16 pm
Andy,

Depending on the database you'll have to use a dot "." or a hyphen "-", so that error you got is normal.
The custom field in the template is always uses a dot.
Yes, I have several templates that use this and it works.

Geert