How to Find the Property and Model Element Type Names in Editing Report Templates

Report composer is a flexible report developing tool, enabling you to control the layout of report content as well as the content to show. You can control the outcome by editing template. Yet, you may find it uneasy to read and edit a template in XML format. Here we are going to share some tips with you. In this article, we will show you how to find out the correct property (e.g. name, modelType) and model element type names (e.g. UseCase, Class) to use in a template.

Before we start, let’s take a look at a build-in template’s content. Read below the content of build-in Children template for Use Case Diagram.

The Children template for use case diagram

The Children template for use case diagram

This template directs the report engine to print a table. Each row in table represents a shape in diagram. The first column in table shows the name of shape while the second column shows the type of shape. Here we have a question: When I am developing my own template, how do I know the property name name and modelType (as highlighted in yellow in image)?

XML is the answer

Let’s say if we want to print out the documentation of shapes in diagram, how do I know the correct property name to use? Shall I use documentation, Documentation, doc, document or something else? Can we find out the answer without guessing?

Although Visual Paradigm does not publish the list of supported element properties and model element types you can use in editing template, you can find them out through extracting the XML content of diagrams/model elements/shapes. Let’s try together.

  1. Open the diagram where the shapes you want to have their information print to report exist.
  2. Let’s say we want to print out the documentation of shapes. Right click on any shape and select Copy > Copy as XML (Traditional) from the popup menu.

    Copy XML of use case

    Copy XML of use case

  3. Open any text editor and paste the copied XML content in it.

    XML of selected element pasted into a text editor

    XML of selected element pasted into a text editor

  4. Use the Find/Search function to locate the portion of the selected element. Enter the name of that element and start finding.

    Locating use case Settle Payment with Find

    Locating use case Settle Payment with Find

  5. Once you have found the model element, you can immediately tell its model element type name (e.g. UseCase) by referring to its property modelType. Note that this skill applies to all elements, not just use case.

    Element type found

    Element type found

  6. Under the Model element you can find a list of properties (e.g. StringProperty, BooleanProperty,etc.)of that element. Pay attention to the name property. This is what you should use as propertyText in template.

    A list of properties of use case

    A list of properties of use case

  7. We can see that the correct property name for documentation is documentation. Note that as long as the properties are the same, their name will be the same even the model element types are different. For instance documentation for both use case and actor both have documentation as property name.

    Property name of documentation

    Property name of documentation

Related Links

Related Videos

1513 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply