Creating a simple report

Now that we have our first project open, we will look at creating our first report. As mentioned previously, we will create a basic listing report that will display all the information in the employees table. In order to do this, use the following steps:

  1. Right-click on the Class_Cars_BIRT_Reports project under the Navigator, and choose New Report.
  2. Make sure the Class_Cars_BIRT_Reports project is highlighted in the New Report dialog and enter the name as EmployeeList.rptdesign. I chose this name as it is somewhat descriptive of the purpose of the report, which is to display a list of employees. As a rule of thumb, always try to name reports after the expected output, such as QuarterlyEarningReport.rptDesign, weeklyPayStub.rptDesign, or accountsPayable.rptDesign.
    Creating a simple report
  3. The next screen has a list of different report templates we can use. We will select Simple Listing and then click on the Finish button.
  4. Go to the Data Explorer, right-click on Data Sources, and choose New Data Source.
  5. From the New Data Source dialog, select Classic Models Inc. Sample Database and click on the Next button.
  6. On the next screen, the driver information is presented. Ignore this for now and click on the Finish button.
  7. Under the Data Explorer, right-click on Data Sets and choose New Data Set.
  8. On the next screen, enter the Data Set Name as dsetEmployee, and make sure that our created Data Source is selected in the list of data sources. Then click the Next button when this is finished.
    Creating a simple report
  9. In the Query Dialog, enter the following query and click the Finish button:
    select
    *
    from CLASSICMODELS.EMPLOYEES
    
  10. In the next screen, just click the OK button. This screen is used to edit information about Data Sets, and we will ignore it for now.
    Creating a simple report
  11. Now, from the Outline, select Data Sets and expand it to show all of the fields. Drag-and-drop the EMPLOYEENUMBER element over to the Report Designer and drop it on the cell with the label of Detail Row. This will be the second row and the first column. You might see an error in the table. Ignore it for now. This will be here until we finish dragging elements over and save the report.
  12. We will notice that when we do this, the header row also gets an element placed in it called EMPLOYEENUMBER. This is the Header label. Double-click on this cell and it will be highlighted. We can now edit it. Type in Employee ID.
  13. Drag-and-drop the LASTNAME, FIRSTNAME, and JOBTITLE to the detail cells to the right of the EMPLOYEENUMBER cell.
    Creating a simple report
  14. Now, we want to put the header row in bold font. Under the Outline, select the Row element located under Body | Table | Header. This will change the Property Editor contents. Click on Font, and then click the Bold button.
Creating a simple report

And that's it! We have created our first basic report. To see what this report looks like, under the Report Designer pane, click on the Preview tab. Alternatively, we can actually Run the report and get an idea of what this report will look like in the BIRT Report Viewer application by going up to File | View Report in the web browser. This option is also available by right-clicking on the Report Design file under the Navigator, choosing Report, and then clicking Run.

Creating a simple report

Although it may be a simple report, this exercise demonstrated how a report developer can get through the BIRT environment and how the different elements of the BIRT perspective work together.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset