Page History
To edit report data
Click Tools > Report Wizard.
Select a template and click .
Click . The Edit Report Data dialog will appear.
Editing a report data in the Edit Report Data dialog
Edit the report’s name and description, and then click .
How to delete a How to clone a
To delete report data
Click Tools > Report Wizard.
Select a template and click .
Click . The Confirm delete dialog will appear.
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.
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.
The Copy of My Report created in the Report Data Management pane.
Content layer | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
How to edit a To create a Report Data in a MagicDraw project
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Expand | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Expand | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
title | title | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Expand |
Tip |
---|
When a cloned Report Data is created, a copy of the Report Data (variable) will also be created. |
Anchor | ||||
---|---|---|---|---|
|
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.
ExpandtitleHow titleHow to
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.
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.
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 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 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.
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.
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.
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.
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. |
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”.
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.
The resulting RTF file
Panel | ||
---|---|---|
| ||
|
Glossary
Expandtitle
.
Glossary
- Clone
To clone is to create an exact copy of report data.
Sample model
View file | ||||
---|---|---|---|---|
|
- 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:
Sample model
View file | ||||
---|---|---|---|---|
|