Report Wizard can automatically import a Template Tool to a template without having to declare the #import statement in a template code manually (see Importing Custom Tool to Template).

To enable Report Wizard to automatically import a Template Tool, you have to use the existing template variable inside “template.xml” and “report.xml”.

The current template variable syntax:

<variable>
  <name>Variable Name</name>
  <description>Variable Description</description>
  <type/>
  <value xml:space="preserve">Variable Value</value>
</variable>

Add "com.nomagic.magicreport.engine.Tool" to a type value where the name is a variable name and the value is a full-qualified template tool class, for example:

To automatically import TextTool


  1. Edit the built-in.xml file in the ...\data\reports\Tutorial 24 - Text Tool\reports.
  2. Add a variable as shown in the following example.
<variable>
  <name>text</name>
  <description>A text tool</description>
  <type>com.nomagic.magicreport.engine.Tool</type>
  <value xml:space="preserve">com.nomagic.reportwizard.tools.TextTool</value>
</variable>

The result is a template code that can access com.nomagic.reportwizard.tools.TextTool from $text.

$text.noLineBreak($diagram.name)

Once you have edited a template variable, you have to restart MagicDraw prior to generating a report through MagicDraw.