Book a Demo

Author Topic: Generating a report with 2 values, each from a diffrent query, in one fragment  (Read 5008 times)

tzafrir

  • EA User
  • **
  • Posts: 127
  • Karma: +0/-0
    • View Profile
hi,

The problem:
I am creating a report and I need to have 2 values (each from a different query) presented in one fragment

Is it possible to put 2 queries together in one fragment? If yes, can someone give a simple example what the correct way that it should be done because currently I am only able to put one.

Thanks,
Tzafrir

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Hi,

With SQL and also with a Model Script you can select an arbitrary information to visualize with your Template Fragment. Each column may be from a different model element or model element type. With SQL you accomplish this with e.g. "UNION".

There is also the possibility to use a Document Script to return rtf.

You find a description:
http://www.sparxsystems.com/enterprise_architect_user_guide/13.0/model_publishing/custom_query_fragments.html

Kind regards,

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

tzafrir

  • EA User
  • **
  • Posts: 127
  • Karma: +0/-0
    • View Profile
Union does not work here as I need to extract diffrent values in each query.
This is more general question, is there option to put 2 queries together in 1 fregment.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
There's only one query per sql fragment.

Union will still be possible, just explicitly put empty values in.

eg.
Code: [Select]
select Name, Stereotype, GenType, '' as AttType from t_object where Object_Type='Class'
union
select Name, Stereotype, '' as GenType, [Type] as AttType from t_attribute

It does make me think you should probably rethink what you are trying to do or the approach to it. eg. The template selector allows you to select a different template based on object type.