How to generate report for class diagram?

Hi,
Let consider an example: a class diagram with a class which has an attribute. The objective is to generate report (using Report Composer) which will show on first line - diagram name, on second line - class name, on third line - attribute name. To solve the task I use corresponding template (below), but result is not great - I have only diagram name and class name - no attribute name, though template code, for extraction of attributes (very internal IterationBlock), essentially the same as in standard Attributes template (for class) and works well if used on the class level. What is wrong with my template?

<?xml version="1.0" encoding="UTF-8"?>

hey, i got a hey, i got a questin after im done with mankig the template why does the background become white? and the text background basicly deletes? it happened to you at 3:03, but idk how you fixed it. Please reply with help ! Was this answer helpful?

This is a very late response but I just struggled with the same issue and finally cracked the code. Maybe someone else can benefit later on :slight_smile:

Here’s a way to solve this problem:

  1. Select your diagram in the Diagram Navigator and pick a simple Property/xml to generate the name of the diagram. Something like:



  2. Now expand the diagram in the Diagram Navigator so you see all its content (associations, attributes etc).
  3. Left click on your diagram and pick Sorting > Sorting by Type.
  4. Select all your classes and pick a simple Property/xml to generate the name of class and attribute. I did a modification of Attributes Summary which worked perfectly. Something like this: