Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Guillaume on November 27, 2019, 12:38:10 am

Title: RTF Generation: display tagged values only is populated
Post by: Guillaume on November 27, 2019, 12:38:10 am
I'm working with an RTF template and need to achieve the following: for an element in my package, display the Name and 2 tagged values e.g.
{Element.Name}
Property A : {Element.valueOf(tag1)}
Property B : {Element.valueOf(tag2)}
-> I want to remove the "Property A : " label when tag1 value is empty. Is there an option or workaround (fragments?)  to achieve that? All the filters that I found apply to elements, connectors or diagram, not a tagged value of the generated element.

Note: tagged values can be rendered with specific fonts or within a table (so I don't want to generate the table when the tagged value is empty).

Title: Re: RTF Generation: display tagged values only is populated
Post by: Geert Bellekens on November 27, 2019, 05:32:12 am
Have you tried with the bookmarks?

Personally I would probably go for an SQL fragment as that is easier than the trial and error guessing game with the bookmarks.

Geert
Title: Re: RTF Generation: display tagged values only is populated
Post by: Guillaume on November 29, 2019, 02:05:56 am
Hi Geert,

I managed to get it to work with a small SQL fragment. Down side is that I have as many SQL fragment as tagged values I need to generate but it does the job.

Cheers
Title: Re: RTF Generation: display tagged values only is populated
Post by: Geert Bellekens on November 29, 2019, 03:34:49 pm
Hi Geert,

I managed to get it to work with a small SQL fragment. Down side is that I have as many SQL fragment as tagged values I need to generate but it does the job.

Cheers
Hmm, I think with a clever use of CASE WHEN... you can probably combine all of the tagged values into one fragment. I did that in a number of templates.

Geert
Title: Re: RTF Generation: display tagged values only is populated
Post by: Guillaume on November 29, 2019, 06:52:17 pm
Thanks for the hint Geert. I'll give it a go.