Creating a New Report Activity

 

 

 

Step

Action

1. 

Note: Activity End Result

 

 

At the end of this activity,

as displayed above, the department_report.jrxml view appears and the Fields node in the Outline view displays the two database fields:

 

- department_id

- department_description

 

To achieve this you use the New Report Wizard to define a SQL report query with the foodmart data source.

2. 

Note: Make sure that

 

 

1. Jaspersoft Studio is open

2. The Report Design perspective is reset

3. 

Note: The business requirement is to create a report which lists the departments in the Foodmart database.

 

For each department, the report must list the department ID and the department name.

4. 

Begin by clicking the File menu.

5. 

Point to the New menu.

6. 

Click the Jasper Report menu item.

7. 

Note: The New Report Wizard window appears.

 

 

Choose a report template from the templates available.

The default is the Blank A4 template.

8. 

Click the Next button.

9. 

Note: Next, specify the report file name and project location.

10. 

Reports are internally defined by XML files with extension .jrxml

 

Enter a valid value e.g. department_report into theĀ  File name: field.

11. 

Click the Next button.

12. 

Note: Next, define an SQL query to retrieve records from the department table in the Foodmart database.

 

Jaspersoft Studio uses the Foodmart data adapter to access the data source.

13. 

Enter the SQL query select * from department into the  input pane.

14. 

Note: Jaspersoft Studio parses the SQL query.

 

 

It confirms that the Foodmart database contains a department table.

15. 

Click the Next button.

16. 

Note: The Fields page of the New Report Wizard appears.

 

 

The Dataset Fields pane lists the two dataset fields present in the department table which the SQL query references.

17. 

Note: Next, indicate which of the two fields are required for the report.

18. 

Move the department_id field from the Dataset Fields pane to the Fields pane.

 

Double-click the department_id field.

19. 

Move the department_description field from the Dataset Fields pane to the Fields pane.

 

Double-click the department_description field.

20. 

Click the Finish button.

21. 

Note: The report file appears in the project folder with the extension .jrxml.

22. 

Note: Jaspersoft Studio compiles the .jrxml file into a .jasper file.

23. 

Note: The report opens in a  view in the Report Editor  panel.

 

 

The report name is the label for the view tab.

The empty report bands appear.

24. 

Note: The Outline view displays the report's structure.

25. 

In the Outline view, expand the Fields node.

26. 

Note: The expanded Fields node displays the two fields from the SQL query.

 

- department_id

- department_description

27. 

Congratulations!

 

In this activity, you created a report.

End of Procedure.