Report Wizard provides predefined report data templates that you can use to generate a report. The built-in report data template consists of several report data variables such as title, author, scope, and purpose that you can modify and adjust to meet your needs. You can also create a new report data template as needed, and manage the variables using the report data management pane.

This section defines report data, and how to use it in your report to represent variables that you want to include. Click the following links to navigate to the content of this page.

 

Report Data and Variables

A report in Report Wizard has a collection of variables which are called report data. Report Wizard provides a built-in report data for every predefined template. The built-in report data comes with predefined variables and values which you can edit or delete. You can also add more variables to the built-in report data.

 

The built-in report data's predefined variables and values in Report Wizard.

 

You can create your own report data, and add variables and child variables under it if you do not want to use the built-in one. Report Wizard also allows you to create a report data as an element in the Containment tree inside a MagicDraw project by using the Report Profile which allows you to commit the Report Data to Teamwork Server, and share it with other users.

Report Data Management Pane

Report Wizard stores the built-in report data in the Report Data management pane which helps you to organize information into groups , and keep revision history created in a MagicDraw project. 

This pane also allows you to:

  • Create, edit, delete, or clone a Report Data.
  • Create or organize the variables in a Report Data.

 

Report Data Management Pane

Selecting the built-in report data in the Report Data management pane

The following table lists the buttons and their function in the Report Data management pane.

ButtonFunction
Creates report data.

Edits report data.

Deletes report data.

Clones report data.

Creates a report variable.

Working with Report Data

You can create report data either in:

  • Report Wizard in which all data will be saved into an XML file.
  • MagicDraw project, in which case the report data will be saved with the project itself. Saving report data in a project will enable you to commit the report to Teamwork Server.

The following instructions show you how to create and manage your report data in Report Wizard and in a MagicDraw project.

 

  1. Click Tools > Report Wizard.

  2. Select a template and click .

  3. Click . The New Report Data dialog will appear.

    New Report Data Dialog

    Creating a Report Data in the New Report Data dialog

  4. Enter a new report name and description, and then click .

Before creating a report data in a MagicDraw project, you need to use a report profile, Report Profile.mdzip, which is located in the <install.root>\profiles folder.

How to use a report profile (Report Profile.mdzip)

  1. On the MagicDraw main menu, click File Use Project > Use Local Project. The Use Project dialog will open, and the project module path <install.root>\profiles will be selected by default.

    The Use Local Project menu opens the Use Project dialog that contains a report profile you need before creating a report data in a MagicDraw project.


    Selecting a project module path for the report profile and Report Profile.mdzip in the Use Project dialog.

     

     

  2. Select Report Profile and click .

  3. Specify the usage options.

     

    Usage Options.

     

     

  4. Click . The “Report Profile” profile will open in the Containment tree as a read-only profile. You can now use it in your project.

How to create a Report Data in a MagicDraw project

  1. Use Report Profile.mdzip in your MagicDraw project.

  2. Right-click a data model in the Containment tree and select Create Element.

    Creating Report Data in the MagicDraw project


  3. Select Report Data from the menu.

  4. Type the name of the Report Data element in the Containment tree.
     

You can right-click a data model, a package, or a profile in the Containment tree to create a Report Data.

Tag ValuesFunction
autoImageSizeChange the image size.
imageFormatSelect an image format, either JPEG or PNG.
emptyTextStore a string value that will be replaced with an empty variable.
data

Contain elements that will be published by Report Wizard.

templateDetermine which template to use in a particular Report Data.
generateRecursivelyDetermine whether or not a report will be generated recursively.
  1. Click Tools > Report Wizard.

  2. Select a template and click .

  3. Click . The Edit Report Data dialog will appear.

    Edit Report Data Dialog

    Editing a report data in the Edit Report Data dialog

  4. Edit the report’s name and description, and then click .

         

  1. Click Tools > Report Wizard.

  2. Select a template and click .

  3. Click . The Confirm delete dialog will appear.    

    Confirm Delete Dialog

    The Confirm delete dialog

  4. Click either  to delete the selected data or  to cancel the operation.
  1. Click Tools > Report Wizard.

  2. Select a template and click .

  3. Click . The Clone Report dialog will appear.

    Clone Report Dialog

    Cloning a report data in the Clone Report dialog

  4. Enter the name and description of the report. The name should begin with Copy of (cloned report name).

  5. Click . The cloned Report Data will then be created.

Copy of My Report Created in the Report Data Management Pane

The Copy of My Report created in the Report Data Management pane

 

When a cloned Report Data is created, a copy of the Report Data (variable) will also be created.

Working with Report Data Variables

Variables are created because some information is not “naturally” contained in a model, e.g. the company's name, author's name, revisions. Although you can put all of the information in a model's specification (Document/Hyperlinks in the Specification dialog), it is difficult and tedious to get data from the model's specification, as this results in more lines of codes and scripts in the report templates. Therefore, instead of writing lines of codes, you can simply create a variable, give it a name, and call it directly from the template. For example, you can create a variable called “Author” in Report Wizard and write $Author in the template. When you generate the report, you will see the value inside “Author.” Essentially, a variable is used to represent data that you want to include in the report, not in the model.

Variables contain information that you want to store in a project, such as names and dates. You can create a report variable in a MagicDraw project or the Report Wizard dialog.

 

  1. Right-click a Report Data in the Containment tree and select Create Element > Variable. The variable will appear inside the Report Data.


    Creating a variable for Report Data in the Containment tree


You can also create, edit, and delete variables through the Report Variable dialog in Report Wizard.

  1. Open the Report Variable dialog.
  2. Click . The New Variable dialog will open. Enter the variable name and description. You can create either a parent variable or a child variable in the Owner box.

New variable dialog
Creating a new variable in the New Variable dialog

To create a parent variable, type the variable name in the Name box, enter the description, select an empty value in the Owner box, and then click .



Creating a Parent Variable

Creating MyNewVariableName as a parent variable

To create a child variable, type the variable name in the Name box, enter the description, select Parent in the Owner box, and then click .



Creating a Child Variable

Creating a child variable of MyNewVariableName

 

     3.  The new variable will appear in the table in the Report Variable dialog.

     4.  Click  to save the variables in the Report Data.

  1. Open the Report Variable dialog.
  2. Double-click on the column next to the variable name column and click . A dialog will open in which you can edit the variable value.

    Editing Variables

    Editing a variable in the Template Variable dialog

  3. Click . The new variable value will appear in the column next to the variable name column.


  1. Open the Report Variable dialog.
  2. Click a variable in the table, and then click Delete. A dialog will open prompting you to confirm before deleting the selected variable.

    Deleting Variable

    Dialog to confirm the deletion of a report variable

  3. Click  and the variable will be deleted.
  1. Open a blank document in Microsoft Word.
  2. Type: $Parent.

    Referencing to Parent Variable in the Template

    Referencing to a parent variable in the template

  3. Save the file as “sampletemplate.rtf”. Choose Rich Text Format (*.rtf) as the file type.

  4. Open the Report Wizard dialog and click to create a new template. The New Template dialog will open.

  5. Type the name and description of the new template. Click  to select “sampletemplate.rtf” as the template file.

  6. Click  > . The Select Report Data pane will open.

  7. Select a report data, in this example, My Report Data and click  to generate a report. The output of the generated report will be shown as in the following figure.


    The resulting RTF file


    Note

    When you include the variables you have created in a template, each variable value will be included in the generated report. This section will use the following My Report Data as an example.

    Sample of Report Data

  1. Open a blank document in Microsoft Word.
  2. Type any of the following to print a child variable.

    (i) $Parent.get(1) to get a child value by index.

    (ii) $Parent.get(“Child”) to get a child value by name comparison.

    (iii) $Parent.Child to get a child value by referencing its name, in this case “Child”.

    Referencing to Child Variable in the Template

    Referencing to the child variable in the template

  3. Save the file as “sampletemplate.rtf”. Choose Rich Text Format (*.rtf) as the file type.

  4. Open the Report Wizard dialog and click to create a new template. The New Template dialog will open.

  5. Type the name and description of the new template. Click  to select “sampletemplate.rtf” as the template file.

  6. Click  > . The Select Report Data pane will open.

  7. Select a report data, in this example, My Report Data and click  to generate a report. The output of the generated report will be shown as in the following figure.



The resulting RTF file

 

 

On this page

Glossary

 

To clone is to create an exact copy of report data.

Rich Text Format (RTF) is a file format developed by Microsoft that can be used with different word processors in different operating systems.

 

Sample model

Magic Library.mdzip


 

 

More information about working with reports in Report Wizard

To learn more about reports in Report Wizard, you can visit the following pages: