Book a Demo

Author Topic: Can fields be conditionally included in template  (Read 5298 times)

R. Johnson

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Can fields be conditionally included in template
« on: February 11, 2014, 05:36:32 am »
I am trying to conditionally include/exclude fields from my document templates. An example is for Attribute Defaults. If the Default is not blank, then I want to display [Def. : {Att.Default}], otherwise I want to exclude the entire string.

So the output would look like this:

With default: XXXXX [Def. (1)]
Without default : XXXXX

Another place I'd like to be able to do this is in my Element name sections. I have some packages that have line numbering enabled (Requirements, Use Cases, etc) I want to display the Number followed by the Name. But for packages where the line numbering is turned off, I end up having extra space before my names.

Is there any way to do conditional formatting field inclusion?

I'm currently using version 9.0.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Can fields be conditionally included in templa
« Reply #1 on: February 11, 2014, 07:40:22 am »
Hello,

as far as I know there is no solution for EA 9.

Consider using 10/11.

With fragment templates/fragment scripts in EA 10 you can manage conditional output.

Be aware:
There are some problems in EA 10 regarding stability. You ma give it a try. There are threads in this forum.

Regarding line numbering.
I don't know any solution. Maybe another person know something.

Helmut

Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Can fields be conditionally included in templa
« Reply #2 on: February 12, 2014, 08:48:50 am »
EA 11 introduces functionality to do this, and uses it in the standard reports. Unfortunately we haven't put a GUI around the functionality yet.

It is done by adding a bookmark around the field that includes conditional text.

eg.
XXXXX{Att.Default.Start} [Def. ({Att.Default})]{Att.Default.End}

Note that the bookmarks are not visible in the editor. I have coloured, italicized and wrapped them in {} to try to express this.
« Last Edit: February 12, 2014, 08:49:05 am by simonm »

stevesavage

  • EA User
  • **
  • Posts: 119
  • Karma: +4/-0
    • View Profile
Re: Can fields be conditionally included in templa
« Reply #3 on: June 23, 2014, 06:21:45 am »
Has the ability to work with conditional text (in the GUI) been added yet?
« Last Edit: June 23, 2014, 06:27:53 am by realitystorm »

stevesavage

  • EA User
  • **
  • Posts: 119
  • Karma: +4/-0
    • View Profile
Re: Can fields be conditionally included in templa
« Reply #4 on: July 07, 2014, 07:25:31 am »
Can you use this within a "custom" tag?
e.g. I have a custom query result with the field TEST1

Custom.TEST1.Start
and
CustomSQL.TEST1.Start

neither worked.