The previous chapter looked at the BIRT workspace. One should be familiar with the environment he/she will use to build BIRT reports. This chapter will take a look at each of the individual BIRT report elements, some of their uses, and some of their common properties. By gaining some familiarity with these components, we can save ourselves a fair amount of headache while working with BIRT. A surprising number of questions come up while performing some of the more common functions using BIRT components such as how to format numbers as currency or limit decimal places, and how to format dates, along with a few other questions that can be influenced by using simple BIRT properties.
BIRT report components aren't radically different from other visual components used in other visual development environments and report designers. We have some of our more common visual components such as text labels, data bound text elements, and graphics. For those who are already familiar with a web development environment, there are some formatting components that you might already be familiar with such as grids that are similar in function to HTML tables. Then there are some more advanced components such as graphs, tables, cross-tabs, and aggregations.
This chapter will take a look at a number of these components and some of their common uses.
In almost any development environment, you have static text elements—the elements that won't change for one reason or the other. Common uses of static text elements are as field identifiers in online web forms, identification of what some piece of data is, instruction for how to use an application, on screen prompts, and titles. Reporting is no exception to this rule. In reporting, one can see this type of static text content used as column headers for listings, report titles, and as footer information such as copyright lines. BIRT provides this in the form of Labels. The following is the icon used on the development palette for the Label.
In the previous chapter, we saw Labels used as the column headers in our employee listing report, although we didn't have to create them explicitly. We got to see one of the properties for Labels when we changed it and made it bold. This illustrated one of the most common properties of the Label component—font information. This will be the most common property to work with when one works with labels, although it is not the only one.
The Label report item is one of the most common and least technical report items to work with. We are going to create a simple report to demonstrate the properties used with this component. Follow the sequence of steps:
Class_Cars_BIRT_Reports
project under the Navigator tab and choose New | Report. Class_Cars_BIRT_Reports
project is highlighted in the New Report dialog box and enter the File name as HelloWorld.rptDesign
. Notice that we haven't used a space in the filename. This is because some operating systems have issues with spaces in names and it is considered bad etiquette in others to use spaces even if they are allowed.We were easily able to manipulate some basic visual elements of the Label component using the Property Editor. There are a number of other elements such as conditional hiding and hyperlinks that will be covered later in more detail. The important thing to remember about the Label is that it is a text component that is not bound to data in any manner.