Connecting to a JasperReports Server Activity

 

 

 

Step

Action

1. 

Note: Activity End Result

 

 

At the end of this activity, the Accounts Report preview appears as displayed above.

 

To achieve this result, you

 

1. Create a Server Connection

2. Navigate the JasperReports Server folder hierarchy to the Acccounts Report folder

3. Run the report remotely.

2. 

Note: Make sure that the Repository Navigator view is active.

3. 

Begin by creating a server connection.

 

Right-click the Servers node.

4. 

Click the Create JasperReports Server Connection menu item.

5. 

Note: The Server Profile Wizard window appears.

6. 

Note: The Name field displays the default value JasperReports Server Pro.

 

The default value is acceptable for this activity.

7. 

Note: The URL field contains the URL to the JasperReports Server instance.

 

By default, the JasperReports Server host is localhost and the port number is 8080.

8. 

The User field displays the default value username.

 

Change the name to an administrator that is defined out-of-the-box for a JasperReports Server instance.

 

Click in the User field.

9. 

Enter jasperadmin into the User field.

10. 

The password for the user jasperadmin is jasperadmin.

 

Enter jasperadmin into the Password field.

11. 

Now, test the connection.

 

Click the Test Connection button.

12. 

Note: The Connection to JasperServer window appears.

 

 

The message states whether the connection is successful.

13. 

Click the OK button.

14. 

Note: If the connection is not successful, make sure to check the field entries and test the connection again.

15. 

In the Server Profile Wizard window, click the Finish button.

16. 

Note: The JasperReports Server Pro connection appears under the Servers node in the Repository Explorer view.

17. 

Note: Task 1: Create and test a JasperReports Server connection, is complete.

18. 

Next, inspect the folder hierarchy on the JasperReports Server.

 

Minimize the Outline view to increase the vertical space available for the Repository Explorer view.

 

Click the Minimize button.

19. 

Note: The Outline view is minimized.

20. 

Expand the JasperReports Server Pro node.

21. 

Note: The top-level folders on the server appear.

22. 

Expand the Ad Hoc Components folder.

23. 

Note: The Ad Hoc Components folder contains two subfolders.

24. 

Expand Public folder.

25. 

Expand the  Samples subfolder.

26. 

Expand the Reports subfolder.

27. 

Collapse the Ad Hoc Components folder.

28. 

Note: Task 2: Inspect the folder hierarchy of a JasperReports Server, is complete.

29. 

Next, run a report on the JasperReports Server.

 

Expand the 05. Accounts Report folder.

30. 

Note: The report folder expands.

 

 

However, the folder contents may be only partially visible.

31. 

As needed, scroll the Outline view to inspect the folder contents.

 

Click the Horizontal scrollbar.

32. 

Note: The 05. Accounts Report folder is called a report unit.

 

 

The folder contains three files:

- Main.jrxml

- Jaspersoft_logo.png

- SampleReportsStyles.jrtx

33. 

Now, run the report remotely and display the results locally within Jaspersoft Studio.

 

Right-click the Main jrxml file.

34. 

Click the Run Report Unit menu item.

35. 

Note: A view opens in the Report Editor pane displaying the report.

 

The view does not have a Design, Source, or Preview tab.

36. 

Note: Task 3: Run a report remotely, is complete.

37. 

Next, inspect the report unit properties.

 

Right-click the 05. Accounts Report folder.

38. 

Click the Properties menu item.

39. 

Note: The Resource Editor window appears.

 

 

The Resource Editor allows the report designer to change resources on the server.

 

The Report Unit tab is active.

40. 

Click the Data Source tab.

41. 

Note: The Data Source tab is active.

 

 

A data source resource on a JasperReport server is similar to a data adapter in Jaspersoft Studio.

 

The data source resource for the Account Report is located in the Data Sources folder under the /public/Samples folder. Multiple reports can use this resource.

42. 

Click the Cancel button.

43. 

Congratulations!

 

In this activity, you completed the following four tasks:

 

1. Created and tested a JasperReports Server connection

2. Inspected the folder hierarchy of a JasperReports Server

3. Ran a report remotely

4. Inspected the report unit properties

End of Procedure.