blob: 0209220815c802d65c9b81b0074f05e1a0d879ac [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 transitional//EN">
<html>
<head>
<title>BIRT Tutorial</title>
<link rel="stylesheet" href="../style/compose.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p class="head">BIRT Tutorial</p>
<p class="subhead">Using Styles</p>
<h1>About Styles</h1>
<p>
We mentioned that BIRT uses CSS to define the styles for report items. BIRT
also allows you to define the properties in a style sheet, then to apply the
style to a report item, just as in HTML. The result is that you create the style once
and use it multiple times. If you need to change the look of a report, you can
change the style in one place rather then in many different report items. If you've defined your own styles when creating HTML pages, you're well on your
way to understanding the BIRT style system.
</p>
<p class="caution"><span class="caution-head">Release 1.0.1 Note:</span>
Styles in the first BIRT release work only within a
single report (though you can copy &amp; paste them across reports.) A later BIRT
release will create separate style sheet files that let you share styles
across a suite of reports. BIRT style sheets will be very similar to the external
style sheet files in CSS.</p>
<h1>Creating a Style</h1>
<p>
Let's use the style feature to format the table header. Let's make the table
header a blue bar with contrasting text. Instead of formatting each label one-by-one,
we'll define a style, then apply it.
<ul>
<li>Select the first label in the Table Header band.
<li>Select Style&rarr;Add Style from the context menu.
<li>The Style Properties dialog appears.
<li>Enter &quot;Header&quot; in the Name field on the General page.<li>Switch to the Background page.
<li>Click the Background color button and choose the same blue: third from the right
in the top row.
<li>Switch to the Font page.
<li>Set the Color to white.
<li>Set the Weight to Bold.
<li>Click OK.
</ul>
<p>
Notice that the new style has been applied to the label.
<h1>Applying a Style</h1>
<p>
Next, let's apply the style to the other three header labels. (We could have done
this in a single step by selecting all four when we defined the style. We're
doing it in two steps just to show how it's done.)
<ul>
<li>Select the other three labels: click on the City label, then use Ctrl+click to add
the other two to the selection.
<li>Choose Style&rarr;Apply Style Rule&#8594;Header from the context menu.
</ul>
<p>
The other three cells are now also formatted.
<h1>Editing a Style</h1>
<p>
Suppose we wanted to change the style we just created. Here's how we find
and change it.
<ul>
<li>Find or open the Outline view.
<li>Scroll down to the bottom and find the Styles node.
<li>Open the Styles node to reveal our styles.
<li>Double-click the style you want to edit.
</ul>
</body>
</html>