Use of a Styles Template


Instead of repeatedly defining similar styles for each report, you can define a style in the styles library and reuse it in other reports. To achieve this you can use a style template (called also Styles Library in iReport), which is a container where one or more styles are stored. In this container there must be only styles.

Open a report, right click on the Styles node into the Outline View and select "Create Style Template".

Figure 1. Select the action to load a template

Select the action to load a template

Now a new dialog will be opened and from here you can select a style template created before. Select the style and hit Ok.

Figure 2. Select a template

Select a template

Now you can use the styles defined in the imported template in a similar way of the normal styles. Just select an element and from its properties use the one named "Style". Here you will find a combobox showing the available styles. But note that are shown only the internal ones, the external ones (which comes from a template) must be selected by typing directly their names.

Figure 3. Assign the external style to the element

Assign the external style to the element