





















































Using the power of stylesheets and libraries, one has the ability to apply general formatting to an entire report design using themes and reuse these among different reports. Themes provide a simple mechanism to apply a wide range of styles to an entire report design without the need to manually apply them.
The following example will move the styles that we have created in our library and will show how to apply them to our report using a theme.
Now, we know that we can create several different themes by grouping styles together in libraries. So, when developing reports, you can create several different looks that can be applied to reports, simply by applying themes to reports with the help of libraries.
Another stylesheet feature is the ability to use external stylesheets and simply link to them. This works out very well when report documents are embedded into existing web portals by using the portals stylesheets to keep a consistent look and feel. This creates a sense of uniformity in the overall site.
Imagine that our graphics designer gives us a CSS file and asks us to design our reports around it. There are two ways one can use CSS files in BIRT:
In the following examples we are going to illustrate both scenarios. I have a CSS file containing six styles—five styles that are for predefined elements in reports and one style that is a custom style.
The following is the CSS stylesheet for the given report:
.page {
background-color: #FFFFFF;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 24px;
color: #336699;
}
.table-group-footer-1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 24px;
color: #333333;
background-color: #FFFFCC;
}
.title {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 24px;
line-height: 40px;
background-color: #99CC00;
color: #003333;
font-weight: bolder;
}
.table-header {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
background-color: #669900;
color: #FFFF33;
}
.table-footer {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
line-height: 22px;
color: #333333;
background-color: #CCFF99;
}