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.
![](/plugins/servlet/confluence/placeholder/macro?definition=e2FuY2hvcjpSZXBvcnRkYXRhfQ&locale=en_GB&version=2)
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.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > BuiltinVariables.png](/download/attachments/100216589/BuiltinVariables.png?version=1&modificationDate=1475027626538&api=v2)
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 Cloud, and share it with other users.
![](/plugins/servlet/confluence/placeholder/macro?definition=e2FuY2hvcjpSZXBvcnRkYXRhcGFuZX0&locale=en_GB&version=2)
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.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > Report Wizard Dialog Built-in Report Data.png](/download/attachments/100216589/Report%20Wizard%20Dialog%20Built-in%20Report%20Data.png?version=1&modificationDate=1612509540285&api=v2)
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.
Button | Function |
---|
| Creates report data. |
| Edits report data. |
| Deletes report data. |
| Clones report data. |
| Creates a report variable. |
![](/plugins/servlet/confluence/placeholder/macro?definition=e2FuY2hvcjpXb3JraW5nd2l0aFJlcG9ydGRhdGF9&locale=en_GB&version=2)
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 Cloud.
The following instructions show you how to create and manage your report data in Report Wizard and in a MagicDraw project.
To create report data in Report Wizard
Click Tools > Report Wizard.
Select a template and click
.
Click
. The New Report Data dialog will appear.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > new-report-data-a.png (New Report Data Dialog) New Report Data Dialog](/download/attachments/100216589/new-report-data-a.png?version=1&modificationDate=1469665458214&api=v2)
Creating a Report Data in the New Report Data dialog.
- Enter a new report name and description, and then click
.
Before creating 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.
To use a report profile (Report Profile.mdzip)
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.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > UseLocalProject_menu.png](/download/attachments/100216589/UseLocalProject_menu.png?version=1&modificationDate=1473313628293&api=v2)
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.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > ReportProfile_select.png](/download/attachments/100216589/ReportProfile_select.png?version=1&modificationDate=1473313952745&api=v2)
Selecting a project module path for the report profile and Report Profile.mdzip in the Use Project dialog.
Select Report Profile and click
.
Specify the usage options.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > UsageOptions_select.png](/download/attachments/100216589/UsageOptions_select.png?version=1&modificationDate=1473314161145&api=v2)
Usage Options.
Click
. The “Report Profile” profile will open in the Containment tree as a read-only profile. You can now use it in your project.
![](/plugins/servlet/confluence/placeholder/macro?definition=e2FuY2hvcjpjcmVhdGUgbmV3IHJlcG9ydCBkYXRhIGluIE1EIHByb2plY3R9&locale=en_GB&version=2)
To create a Report Data in a MagicDraw project
Use Report Profile.mdzip in your MagicDraw project.
Right-click a data model in the Containment tree and select Create Element.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > ReportProfile_ReportData.png](/download/attachments/100216589/ReportProfile_ReportData.png?version=1&modificationDate=1473906030340&api=v2)
Creating Report Data in the MagicDraw project
Select Report Data from the menu.
- 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 Values | Function |
---|
autoImageSize | Change the image size. |
imageFormat | Select an image format, either JPEG or PNG. |
emptyText | Store a string value that will be replaced with an empty variable. |
data | Contain elements that will be published by Report Wizard. |
template | Determine which template to use in a particular Report Data. |
generateRecursively | Determine whether or not a report will be generated recursively. |
To edit report data
Click Tools > Report Wizard.
Select a template and click
.
Click
. The Edit Report Data dialog will appear.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > edit-report-data-a.png (Edit Report Data Dialog) Edit Report Data Dialog](/download/attachments/100216589/edit-report-data-a.png?version=1&modificationDate=1469665458266&api=v2)
Editing a report data in the Edit Report Data dialog
Edit the report’s name and description, and then click
.
To delete report data
Click Tools > Report Wizard.
Select a template and click
.
Click
. The Confirm delete dialog will appear.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > confirm-delete-report-data.png (Confirm Delete Dialog) Confirm Delete Dialog](/download/attachments/100216589/confirm-delete-report-data.png?version=1&modificationDate=1469665458322&api=v2)
The Confirm delete dialog.
- Click either
to delete the selected data or
to cancel the operation.
To clone report data
Click Tools > Report Wizard.
Select a template and click
.
Click
. The Clone Report dialog will appear.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > clone-report-b.png (Clone Report Dialog) Clone Report Dialog](/download/attachments/100216589/clone-report-b.png?version=1&modificationDate=1469665458344&api=v2)
Cloning a report data in the Clone Report dialog.
Enter the name and description of the report. The name should begin with Copy of (cloned report name).
Click
. The cloned Report Data will then be created.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > Report Wizard Dialog Copy of My Report.png](/download/attachments/100216589/Report%20Wizard%20Dialog%20Copy%20of%20My%20Report.png?version=1&modificationDate=1612509628353&api=v2)
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. |
![](/plugins/servlet/confluence/placeholder/macro?definition=e2FuY2hvcjpXb3JraW5nd2l0aFJlcG9ydHZhcmlhYmxlc30&locale=en_GB&version=2)
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.
To create a report variable in a MagicDraw project
Right-click a Report Data in the Containment tree and select Create Element > Variable. The variable will appear inside the Report Data.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > ReportProfile_Variable.png](/download/attachments/100216589/ReportProfile_Variable.png?version=1&modificationDate=1473908191758&api=v2)
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.
To create a report variable in the Report Wizard dialog
- Open the Report Variable dialog.
- 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.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > new-variable-b.png (New variable dialog) New variable dialog](/download/attachments/100216589/new-variable-b.png?version=1&modificationDate=1469665458623&api=v2)
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
.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > new-variable-c.png (Creating a Parent Variable) Creating a Parent Variable](/download/attachments/100216589/new-variable-c.png?version=1&modificationDate=1469665458643&api=v2)
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
.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > new-variable-d.png (Creating a Child Variable) Creating a Child Variable](/download/attachments/100216589/new-variable-d.png?version=1&modificationDate=1469665458664&api=v2)
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.
To edit a report variable
- Open the Report Variable dialog.
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.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > new-variable-e.png (Editing Variables) Editing Variables](/download/attachments/100216589/new-variable-e.png?version=1&modificationDate=1469665458713&api=v2)
Editing a variable in the Template Variable dialog
- Click
. The new variable value will appear in the column next to the variable name column.
To delete a report variable
- Open the Report Variable dialog.
Click a variable in the table, and then click Delete. A dialog will open prompting you to confirm before deleting the selected variable.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > delete-variable-b.png (Deleting Variable) Deleting Variable](/download/attachments/100216589/delete-variable-b.png?version=1&modificationDate=1469665458741&api=v2)
Dialog to confirm the deletion of a report variable
- Click
and the variable will be deleted.
To get the value of a top-level variable
- Open a blank document in Microsoft Word.
Type: $Parent.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > MSWORD.png (Referencing to Parent Variable in the Template) Referencing to Parent Variable in the Template](/download/attachments/100216589/MSWORD.png?version=1&modificationDate=1469665458785&api=v2)
Referencing to a parent variable in the template.
Save the file as “sampletemplate.rtf”. Choose Rich Text Format (*.rtf) as the file type.
Open the Report Wizard dialog and click
to create a new template. The New Template dialog will open.
Type the name and description of the new template. Click
to select “sampletemplate.rtf” as the template file.
Click
>
. The Select Report Data pane will open.
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.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > parent_result.png](/download/attachments/100216589/parent_result.png?version=1&modificationDate=1469665458854&api=v2)
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. ![MagicDraw 2022x Refresh1 > Report Data Management Pane > sample of report data.png (Sample of Report Data) Sample of Report Data](/download/attachments/100216589/sample%20of%20report%20data.png?version=1&modificationDate=1469665458763&api=v2)
My Report Data as an example. |
To get the value of the child of a variable
- Open a blank document in Microsoft Word.
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”.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > MSWORD2.png (Referencing to Child Variable in the Template) Referencing to Child Variable in the Template](/download/attachments/100216589/MSWORD2.png?version=1&modificationDate=1469665458882&api=v2)
Referencing to the child variable in the template
Save the file as “sampletemplate.rtf”. Choose Rich Text Format (*.rtf) as the file type.
Open the Report Wizard dialog and click
to create a new template. The New Template dialog will open.
Type the name and description of the new template. Click
to select “sampletemplate.rtf” as the template file.
Click
>
. The Select Report Data pane will open.
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.
![MagicDraw 2022x Refresh1 > Report Data Management Pane > child_result.png](/download/attachments/100216589/child_result.png?version=1&modificationDate=1469665458903&api=v2)
The resulting RTF file.
Glossary
- Clone
To clone is to create an exact copy of report data.
- RTF
Rich Text Format (RTF) is a file format developed by Microsoft that can be used with different word processors in different operating systems.
More information about working with reports in Report Wizard
To learn more about reports in Report Wizard, you can visit the following pages: