Book a Demo

Author Topic: HTML report filter  (Read 4366 times)

mbabos

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
HTML report filter
« on: May 27, 2021, 06:53:18 pm »
Hello everyone,

I would like to filter the model elements to put only certain element types into our HTML report. For example, "only gateways with non-empty notes" My first idea was to create a report package with one model document, and reference a model search in the SearchName.
As model search I created a custom SQL search, like this (only for testing without any WHERE clause):

Select
   ea_guid AS CLASSGUID, Object_Type AS CLASSTYPE, name as Name, Object_Type as Type
from t_object

When I try this search in the Find dialog, it returns results (obviously :)).
When I generate the HTML report on the report package, it is empty. I also tried with Common Searches to just search for an existing package name, report is empty too.
Now I read in the HTML reports PDF documentation on sparx website, that you would create a model document by adding elements to the model document, but explicitly not by adding a model search.
So is the model search approach not possible with HTML reports? Is there any other way to achieve this, maybe by modifying the javascript templates?

Thanks in advance,
Martin

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: HTML report filter
« Reply #1 on: May 27, 2021, 07:36:24 pm »
I think the HTML export only works on package level, not on element level. So you wouldn't be able to filter out any elements that way.

So I guess your only option is to try and play with the html templates. Good luck with that.

Geert

malcolmK102

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: HTML report filter
« Reply #2 on: May 30, 2021, 02:44:55 am »
As Geert says, you cannot filter the HTML output other than through packages. I have used two workarounds to get round this.

Option 1: Add Exception Text
Add some exception text, so the page doesn't look broken or out-of-date. As an example, see: http://www.kybernetica.co.uk/KyberneticaSparx/index.htm?guid={7746EFCB-934E-46b6-ADB6-018C10BAB72C}

The exception text is in dark red and says "There is no description for this element". Obviously, you can use any text you like – or even reference a graphic file or write-in a feedback form or some other feature.

This option depends on use of Jquery and custom CSS code – if you want to pursue this, I can post sample some code that works (this code is split between three Web Template Fragments).

Option 2: Move elements to a non-published package
If you want to exclude a specific element – or collection of elements – then you will need to put them in a separate package that will not be published. For example, in the example below, I have excluded all "Model View" elements. On the diagram, they are now unclickable: http://www.kybernetica.co.uk/KyberneticaSparx/index.htm?guid={CE46B582-5727-45aa-BEB5-125B1D77EF0C}

The same principle could be applied for individual elements, though that of course requires an additional maintenance overhead (e.g. a pre-publication routine whereby you (a) use a SQL query to find all elements that have a description AND are outside the publication package; then, (b) move them to the publication package).

Notes
  • The links above are to my own Sparx demo model (which models what I think is necessary - both in terms of functionality and competencies - for any "enterprise class" modelling tool and how Sparx potentially realizes these requirements). As you can see, this web output uses extensive customization: you can reverse engineer as you see fit, but clearly, it won't be possible to post here everything that is going on (the actual code used for example is tightly-coupled with the underlying meta-model, which essentially defines the information architecture of the web output).
  • And finally, you cannot even hope to make Sparx's utterly primitive and amateurish "dog's dinner" of a design credible and useful without resorting to Jquery – see https://jquery.com/ and for specific coding problems, stackoverflow is your best friend.


wivel

  • EA User
  • **
  • Posts: 243
  • Karma: +12/-1
  • Driven by Models
    • View Profile
Re: HTML report filter
« Reply #3 on: May 30, 2021, 06:51:53 am »
Hi

Im with Geert on this, but changing the HTML templates is not for the faint hearted. Also Sparx has acknowledged that the HTML generator is only still present for backwards compatibility. Sparx are pushing WebEA and Prolaborate to be the tools for web publishing and no more development is being put into the HTML generator.

Henrik