Creating a report including the names of actors, use cases, and diagram images

This section will use part of the Inventory Control System.mdzip file as an example to illustrate how to reference to MagicDraw elements in a report. This example contains several packages. For instance, if you want to use the 'Use Case View' package, you need to know the elements inside the package before using it. To do this, follow the instructions in the previous section, Creating your first template.

The 'Use Case View' package contains three element types: Actor, UseCase, and Diagram that you can name in a template by typing "$Actor," "$UseCase," and "$Diagram" respectively. The following example shows you how to create a report that will print the names of the Actors, UseCases, and diagram images.

 

To create a report that includes the names of Actor, Use Cases, and diagram images


  1. Open Microsoft Word or OpenOffice.org Writer.
  2. Use the #foreach directive to iterate through $Actor, $UseCase, and $Diagram.

    A Rich Text Format Template

    Using #foreach directive to iterate through $Actor, $UseCase, and $Diagram in a Rich Text Format template.
  3. Use Report Wizard to add the template to MagicDraw.
  4. With the "Inventory Control System.mdzip" project open, open the Report Wizard dialog and select your template.
  5. Select the element scope so it covers only the "Use Case View" package.

    Selecting the Use Case View package from the model as the element scope to be included in the report.
  6. Complete all steps in the Report Wizard dialog, and generate the report. The output will be shown as in the following figure.

    Shows a partial report output. A full report will print all the names of the Actors, Use Cases, and the Use Case diagrams.

Glossary

Sample model

More information about creating report templates

To learn more about working with report templates, visit the following pages:

Creating Your First Template

Linking report templates to MagicDraw

Exercise: Building a simple class diagram report