Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: lcarlson on February 13, 2019, 07:49:21 am

Title: Fragments & Bookmarks - Hiding field labels
Post by: lcarlson on February 13, 2019, 07:49:21 am
I have been able to successfully use bookmarks to hide a label when the associated field is blank. For instance: my template reads something like: 
1.       constraint-pre >
2.       {ElemExtRequirement.Name}
3.       ^Description: {ElemExtRequirement.Notes}
4.       ^^< constraint-pre
The bookmarks are:
            ^ = ElemExtRequirement.Notes.Start

          ^^ = ElemExtRequirement.Notes.End
 Then when the Requirements are printed in the report, if there is no data for the ElemExtRequirement.Notes field, the Description: label does not print either.
 
 
  All Good so far....
 
 
   Now! I have SQL fragments with generic fields.   
1.       custom >
2.       {objectName}
3.       ^Description: {objectNote}
4.       ^^^< custom
at the ^ and ^^ designations, I have tried a variety of bookmarks, but they never work to hide the Description label:
·         
objectNote.Start and objectNote.End
·         object.Note.Start and object.Note.End
·         ElemExtRequirement.Notes.Start and ElemExtRequirement.Notes.End
·         CustomSQL_objectNote_TITLE_Begin and CustomSQL_objectNote_TITLE_End
·         objectNote_TITLE_Begin and objectNote_TITLE_End
·         CustomSQL_TITLE_Begin and CustomSQL_TITLE_End**
 
Any suggestions?
 
 **The last set of bookmarks, worked fabulously for creating a title to print for the Fragment in the Report and hide if there was no data pulled for that Fragment.
 
 Thanks!
 Laura
Title: Re: Fragments & Bookmarks - Hiding field labels
Post by: Geert Bellekens on February 13, 2019, 04:17:08 pm
Laura,

You could return the Description label in your sql fragment as well.

(e.g "select 'Description:' as DescriptionTitle, o.Notes as Description, ..."

Now you can skip it when there is not description.

Geert

Title: Re: Fragments & Bookmarks - Hiding field labels
Post by: Farkas on October 13, 2023, 09:19:59 am
Hi,

maybe I'm just lucky, or maybe this feature of EA improved over time, but for me in EA 16.1 64 bit the following bookmark syntax works:  objectNote.Start and objectNote.End.
(I'm using custom script fragments, not sql fragments, though.)

Best regards,
Farkas