Overview

The problem: You have developed your report templates using external resources stored in files. Such resources are images (logos), localisation maps or report documentation.Link to inernationalisation, picture cell definition, report documentation.Now when you want to deploy these report templates on a different computer, these files will be in some other place.

The solution: The enterprise edition of ReportWeaver allows you to specify a map from the original file locations to the locations on the target computer.

The mappings are defined in the header of ReportWeaver's see save file. They can be edited from the menu: Tools/Manage File Mapping .... The save format is explained below, so that deployment tools or installers can modify the mappings programatically.

Editing the mapping definitions

Use the menu Tools/Manage File mappings ... to edit the file mappings.

1. Use the Definitions tab to edit your mapping definitions.
2. Enter the source pattern here.
3. Enter the target replacement here.
4. Press add to add another mapping.
5. Press remove to remove the selected mapping.
6. Press ok when you are done.

1. Use the Results tab to review your mapping definitions. This table lists all mappable resources that appear in your repository.
2. This is the file/url as it was when it was added.
3. This is the kind of resource (icon or doc)
4. This is the resulting location. If it is empty then no pattern matched and the file will be used as is.
5. Shows the mapping that was applied.
6. Shows the report where the file is used. Ellipses (...) indicate that it is used in several reports.

Manual Mapping Definition

The tags take the following form:
<map from="String" to="String"/>

The attributes from and to are two complete or partial strings.

Example:Suppose you have used a logo in your template that comes from a file named:

C:\development\reports\mylogo.png

If you want to run your reports on a different computer, but that logo is now stored at
/usr/local/reportweaver/data/mylogo.png
Then you would write a map like this:

<map from="C:\development\reports\mylogo.png"	to="/usr/local/reportweaver/data/mylogo.png" />

Note:Backslashes \ in windows filenames must not be duplicated in xml files. To escape the special characters: &, ", ', < use the xml escapes &amp; &quot; &apos; &lt;.

If you have several different files in the same directory, then you can map the whole directory:

<map from="C:\development\reports"	to="/usr/local/reportsweaver/logos" />

Note:If several matching entries appear, then the more specific entry takes precedence. In the case of the above entries, the file C:\development\reports\mylogo.png would be read from directory/usr/local/reportweaver/data/mylogo.png, whereas all other files would be read from directory /usr/local/reportsweaver/logos

The filename are also localized: i.e there can be logos or report documentation that is specific to a language or a region. The locale key will be inserted into the file name just before the first dot in the name. If the current locale is de_DE (German as used in Germany), then a file report1_info.html will be looked for in the locations:

report1_info_de_DE.html
report1_info_de.html
report1_info.html

Tracing how Mappings are Applied

Mappings are easily misspelled. To aid in debugging of mappings Reportweaver can be instructed to trace mapping related actions. If you set the properties in the reportweaver.properties file, then ReportWeaver will trace all defined mappings and all attemted mappings to the standard output:

TraceLevel:4
TraceModules:mapdir

The following messages can occur:

mapping file location from: C:\projects\reports\mylogo.png to: C:\reportweaver\deployment\mylogo.png
File location: C:\projects\reports\mylogo.png mapped to: C:\reportweaver\deployment\mylogo.png
File location: C:\joria\joriaicons\joria\pix\adddate16.png not mapped.

The fist line indicates that a mapping definition has been found. The second line shows a mapping that has occured. The third line indicates a file that could not be mapped. This may be intended, or it may point to an error.