Book a Demo

Author Topic: Want to limit documentation results, displayed in a table, using a SQL Fragment  (Read 5919 times)

acaslowitz

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Hello.
I am running SQL fragments against a package of data objects to create a Word documentation table.
I am able to populate full rows of data for the data objects that are selected from my query.
I am also getting blank rows for those data objects that are not selected from my query.
Is there a way I can avoid creating blank rows for those data objects that are not relevant?

Arshad

  • EA User
  • **
  • Posts: 290
  • Karma: +21/-1
    • View Profile
Share the query which you tried so for .

Nizam

  • Prolab Moderator
  • EA User
  • *
  • Posts: 320
  • Karma: +15/-2
  • Model Sharing - Simplified
    • View Profile
    • Professional Model Collaboration
The reporter generally skips the template if there is no resultset.

Are you saying your fragment is called for an object, for which your fragment returns NULL, but still you get a blank row?

If you are after specific details (for e.g. Attributes / Operations / Connectors) placing your fragment call within the subsection will avoid calling the fragment.

acaslowitz

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Hello Nizam.
I am running multiple queries (3 columns of data, each with its own query) against a package of data objects and inserting the results into a table in a Word document.
It is inserting blank rows if the query returns no results.

I am not sure what you mean by "placing your fragment call within the subsection."  I suspect you mean calling the fragment from within the package somewhere?  If so, I'm not sure that will work for me.  This is a dynamic query that could change the result set at any time.  I want it to always iterate through all the data objects, but only create rows where there is data found based on the query. 

Thank you!

Nizam

  • Prolab Moderator
  • EA User
  • *
  • Posts: 320
  • Karma: +15/-2
  • Model Sharing - Simplified
    • View Profile
    • Professional Model Collaboration
Makes more sense, for any slightly complex reports, i've always found the 'document script' fragments to be incredibly useful and flexible.
https://www.sparxsystems.in/blogs/document-generation-using-document-scripts-in-sparx-enterprise-architect/

You can also use the Custom script fragment to achieve this.