BackPrevious Page Next PageNext

XSD Styles

Creating an XSD Style

Modifying an XSD Style

Editing the XSD Style Files

An XSD style, that is a style group in a catalog, can hold a large amount of predefined object properties, giving you more control over the appearance and presentation of your report. By using XSD styles, you can create various visual presentation sets from a single report, and change the visual presentation of your report at runtime.

XSD styles are a JReport specific format and not an industry standard so you may want to use CSS styles which are an industry standard.

By simply selecting a style group at runtime, you can change the look and feel of your report in a dramatic way. JReport style groups can be nested, where the parent group is used as a container of other groups. The style group feature makes it easy to save and apply styles without repeatedly designing them each time.

This section explains how to manage XSD styles using the Style Editor as follows (to display the editor, open the catalog to which you want to add the style groups, then on the Catalog Manager toolbar, click Style).

Style Editor

Creating an XSD style

  1. In the Style Editor, right-click any of the existing groups and select New Style Group from the shortcut menu to display the New Style Group dialog.

    New Style Group dialog

  2. Enter the name and description of the group, then click OK. A new style group will be added to the tree.
  3. Right-click the group and click New Style to display the New Style dialog.

    New Style dialog

  4. Specify the name, type and description of the new style, then click OK.

    The style type indicates the application scope of a style, for example, a style with Label type can only be applied to label objects, and a style with DBField type can only be applied to DBFields.

  5. In the Save Style dialog, add the properties to be included in the style and change the property values as required.

    Save Style dialog

    To add a property, select it from the All Properties box and click Add button. To add all the available properties to the style at a time, click Add All button.

    To edit the value of a property, click its value cell in the Selected Properties box, then input the new value and press Enter on the keyboard to confirm the change.

    To remove a property that has been added, select it from the Selected Properties box and click Remove button. To remove all the added properties at a time, click Remove All button.

  6. Click Save to add the style to the group.
  7. Repeat steps 4 to 7 to add more styles to the group.

Now, an XSD style will have been created. You can then apply the style to your reports.

Notes:

Modifying an XSD style

After an XSD style has been set up, you can further modify it in the Style Editor as follows to suit your requirements.

Editing the XSD style files

In addition to editing the styles (style groups) in the Style Editor, you can also edit the XSD format styles (style groups) outside JReport Designer.

When you save a catalog, the style information is saved to disk at the same time. The related file will be located as follows:

  File Name File Description Location
1. CatalogName_stl.xml Style Group Structure in the Catalog Catalog Folder (The directory where the catalog resides)
2. StyleGroupName_stl.xsd Group/Style information <install_root>\style

The CatalogName_stl.xml file keeps the style group structure information. The following shows an example:

The style group structure in Catalog Manager: The corresponding information in SampleReports_stl.xml:
The style group structure in Catalog Manager
<?xml version="1.0" encoding="UTF-8"?>
<StyleGroup>
<StyleGroupname="Default">
</StyleGroup>
<StyleGroup name="ClassicBlue">
</StyleGroup>
<StyleGroup name="ClassicGreen">
</StyleGroup>
</StyleGroup>

The StyleGroupName_stl.xsd file keeps the group/style information, which in the above sample will be as follows:

The file content of ClassicBlue_stl.xsd:

As you can see in the above code sample, an XML style group file contains style group information, style information, and the style property entry information. You can edit the attributes of an element.

Notes:

BackPrevious Page Next PageNext