Author Topic: Fragments & Bookmarks - Hiding field labels  (Read 3643 times)

lcarlson

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Fragments & Bookmarks - Hiding field labels
« 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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13287
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Fragments & Bookmarks - Hiding field labels
« Reply #1 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


Farkas

  • EA Novice
  • *
  • Posts: 14
  • Karma: +1/-0
    • View Profile
Re: Fragments & Bookmarks - Hiding field labels
« Reply #2 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