BIRT reports must use data that is structured as a table consisting of rows and columns. For a POJO data set to return data in this format, you map methods or members of a POJO class to columns. Listing 12-1 shows an example of a class that represents music CDs. The class describes the members and uses pairs of get and set methods to persist the data. To create a data set using this class, you would map the get methods to columns.
Listing 12-1 This procedure assumes you have already created the POJO data source that this data set uses. Examples in this section refer to the POJO example in Listing 12-1.
1 In Data Source Selection, select the POJO data source to use. Data Set Type displays Actuate POJO Data Set.
1 In POJO Data Set Class Name, specify the POJO class that retrieves the data at run time. Choose Browse to find and select the class.Figure 12-4 shows an example of properties set for a POJO data set.
Figure 12-4
5 Map methods or fields in a POJO class to data set columns, using the following steps:
1 In POJO Class Name, specify the POJO class that contains the get methods to map to columns. You can choose Browse to find and select the class.The data set editor uses a get* filter to display all the get methods in the specified POJO class, as shown in Figure 12-5.
Figure 12-6
3 Repeat the previous step for every column to add to the data set. Figure 12-7 shows an example of column mappings defined in a POJO data set.
Figure 12-7
6 Choose Finish to save the data set. Edit Data Set displays the columns, and provides options for editing the data set.
7 Choose Preview Results to view the data rows returned by the data set. Figure 12-8 shows an example of data rows returned by a POJO data set.
Figure 12-8
|
|
Copyright Actuate Corporation 2012 |