DataHub uses report template code from its report template to create the layout and detail of a DHLink Summary report. You can find the report template file in <install_root>\plugins\com.nomagic.datahub.magicdraw\data\templates\relation.html. You can edit the report template file with any text editors to add more information to the report template. In this scenario, you want to add another attribute to the report template.


The Inside of a Report Template

The report template code inside the report template file and the construction of the report layout and data script.

To add another attribute to the report template and generate a DHLink Summary report


  1. Open the template file located in <install_root>\plugins\com.nomagic.datahub.magicdraw\data\templates\relation.html. with any text editors.
  2. Type the following code in the highlighted area of the report template code fragment to add more attributes to the report template file. For example, if you want to add the Created Thru attributes into the report template file to include them in the DHLink Summary report, you must replace <Attribute name> with Created Thru.

    The code for adding another attribute in the report template file
    <br/>$DataHubReportEngine.decorateHTMLTag($row.sourceElement.entity.getAttributeValue("<Attribute name>"))










    Note

    The name of the attribute you want to add in the report template file must be the same as the one that appears in the Cameo DataHub Properties tab.


    The attribute name, e.g., Created Thru, in the DataHub Properties tab must match the <Attribute name> in the report template code.
  3. Save the template file.

  4. Open the DHLink Summary dialog in MagicDraw to generate the DHLink Summary report.


A DHLink Summary report generated from the report template before adding another attribute.

A DHLink Summary report generated from the report template after adding another attribute.