Creating and Using Simple Domains Activity

 

 

 

Step

Action

1. 

Begin by logging in as an administrator to create a Domain.

 

Enter "jasperadmin" into the User ID field.

2. 

Enter "jasperadmin" into the Password field.

3. 

Log in to JasperReports Server as jasperadmin.

4. 

Next, design a Domain to reference data in the foodmart sample database, then save it to the Training folder.

 

Point to the View menu.

 

**audio

5. 

Click the Repository menu item.

6. 

Expand the Organization folder.

7. 

Note: Use the right-click context menu to open the Domain Designer wizard.

8. 

Right-click the Training folder to view the context menu.

9. 

Point to the Add Resource menu.

10. 

Click the Domain menu item to open the Add New Domain page.

11. 

Note: The Add New Domain page appears.

 

 

Here you name the Domain, specify the save location and data source, and optionally assign security and locale bundle files.

12. 

Enter "Employee Domain" into the Name field.

13. 

Click the Browse button to locate a data source for the Domain.

14. 

Drill down to find the data source.

 

Expand the Organization folder.

15. 

Expand the Analysis Components folder.

16. 

Expand the Analysis Data Sources folder.

17. 

Click the Foodmart Data Source JNDI list item.

18. 

Click the Select button to select the data source and return to the Add New Domain page.

19. 

Note: The data source is identified.

20. 

Now, click the Create with Domain Designer link to open the Select Database Schemas window.

21. 

The sample data is associated with the public schema.

 

Click the public schema list item.

22. 

Click the OK button to open the Domain Designer.

23. 

Note: The Domain Designer wizard appears.

 

 

The first and last of the six tabs are mandatory; the other four tabs are optional.

24. 

Double-click the public_employee table name to move it to the Selected Tables panel.

25. 

This Domain requires only one table.

 

Click the Display tab to move to that page of the Domain Designer.

26. 

On the Display page you create one or more datasets and optionally edit display labels.

 

Double-click the public_employee table to add it to the Sets and Items panel.

27. 

Expand the public_employee dataset to see the database fields included in the Domain.

28. 

Note: Seventeen fields appear.

 

29. 

Note:  To provide user-friendly labels in the Ad Hoc Editor, click the Edit button at the lower right to edit the dataset and field display labels.

30. 

Collapse the public_employee dataset.

31. 

Click the OK button to exit the Domain Designer and return to the Add New Domain page.

32. 

Changes to a Domain are not saved until you click the Submit button.

 

Click the Submit button to commit changes and save the new Domain.

33. 

Make sure the new Domain is saved to the Training folder.

 

Point to the View menu.

34. 

Click the Repository menu item.

35. 

Expand the Organization folder.

36. 

Click the Training folder to view its contents.

37. 

Note: The Domain is saved to the repository.

 

 

Task 1, Design a Domain with the Domain Designer, is complete.

38. 

Next, create a table Ad Hoc view from the Employee Domain and save it as a report.

 

Point to the Create menu.

39. 

Click the Ad Hoc View menu item to open the Data Chooser window.

40. 

Click the Domains tab to view a list of Ad Hoc Domains.

41. 

Expand the Training folder.

42. 

Click the Employee Domain list item.

43. 

Click the Choose Data button to open the Data Chooser wizard.

44. 

Note: The Data Chooser wizard appears.

 

 

The first step is mandatory: specify the fields to make available in the Ad Hoc Editor.

45. 

Make all the fields in the dataset available to the Ad Hoc Editor.

 

Double-click the public_employee dataset to move it to the Selected Fields panel.

46. 

Click the Table button to open the Ad Hoc Editor and design a table view.

47. 

Note: The Ad Hoc Editor appears.

48. 

Note: The public_employee dataset is automatically split into two sets.

 

Numeric database fields appear in the Measures panel below, and all others appear above in the Fields panel.

49. 

Up in the Fields panel, expand the public_employee dataset to view its field names.

50. 

Double-click or drag and drop to add fields to the view.

 

Double-click the first_name field.

51. 

Note: The field appears as a column in the view.

52. 

Double-click to add these five fields:

- last_name

- education_level

- marital_status

- position_title

- hire_date

53. 

Double-click the education_level field.

54. 

Double-click the marital_status field.

55. 

Double-click the position_title field.

56. 

Double-click the hire_date field.

57. 

Note: The view includes six fields.

58. 

Down in the Measures panel, expand the public_employee dataset to view the measures.

59. 

Double-click the salary measure to add it to the view.

60. 

Note: Measures are represented in the Columns box with different-colored tiles.

61. 

Note: You can hide the side panels when you need more room to work with the view, and then click again to return the panels.

62. 

Now, provide more room to the canvas area so you can see all seven columns.

 

Near the top-left corner, click the small gray icon at the left of Domain: Employee Domain to hide the Fields panel.

63. 

Likewise at the right, click to hide the Filters panel.

64. 

Now, add a title to the view.

 

Click the Title bar.

65. 

Enter "Human Resources Info" into the Title field.

66. 

Press [Enter] to commit the edit.

67. 

By default, only fifteen records display when you design a view.

 

Click the Sample Data list.

68. 

Click the Full Data list item.

69. 

Click the scrollbar to view additional records.

70. 

Note: Select Full Data in the drop-down to view all records returned by the query.

71. 

Return to Sample Data view.

 

Click the Full Data list.

72. 

Click the Sample Data list item.

73. 

Note: The default fifteen records display again.

74. 

Next, save the layout as a view and report.

 

Point to the Save menu.

75. 

Click the Save Ad Hoc View and Create Report menu item.

76. 

Note: The Save window appears.

 

77. 

Enter "Employee Domain Ad Hoc View" into the Data View Name field.

78. 

Enter "Employee Domain Ad Hoc Report" into the Report Name field.

79. 

Save the view and report in the Training folder.

 

Expand the Organization folder.

80. 

Click the Training folder.

81. 

Click the Save button to save the view and report in the Training folder.

82. 

Note: Task 2, Create and save an Ad Hoc view and report based on the Domain, is complete.

83. 

Next, open the report and explore personalizing and formatting.

 

Point to the View menu.

84. 

Click the Repository menu item.

85. 

Note: JasperReports Server remembers that the Training folder was selected when you last visited the repository view page.

86. 

Click the Employee Domain Ad Hoc Report link to execute the report.

87. 

Note: The report opens for viewing.

88. 

Now, view the column menu.

 

Click the education_level column to select it.

89. 

Note: The column menu appears when you click anywhere in a column.

90. 

Format the education_level column header.

 

Point to the Formatting menu.

91. 

Click the Formatting list item to open the Format column window.

92. 

Rename the column.

 

Enter "Education" into the Heading text field.

93. 

Increase the font size of the column header.

 

Click the 12 list item.

94. 

Add underline to the column header.

 

Click the Underline button.

95. 

Click the Font color button to open the font color window.

96. 

Click to select the dark red cell.

97. 

Note: The new header is size 12, bold, underlinded and colored dark red.

98. 

Click the OK button to save changes and close the window.

99. 

Note: The column header is formatted to your specification.

 

 

In a live environment you would likely format all column headers to match.

100. 

Now, filter the report to view only records of employees who have earned a Bachelors Degree.

 

Click the Education column to view the column menu.

101. 

Click the Column filters button to open the Filter column window.

102. 

Click the Show only rows where option to configure a filter.

103. 

Configure the filter to identify employees whose education level value contains the word Bachelors.

 

Click the Operators list.

104. 

Click the Contains list item.

105. 

Enter "Bachelors" into the Filters field.

106. 

Click the OK button to save the new filter.

107. 

Note: The report displays records of employees who have earned a Bachelors Degree.

108. 

Note: The star icon indicates a filter is configured on a column.

109. 

Next, sort on the last name field.

 

Click the last_name column to view the column menu.

110. 

Click the Sort ascending button.

111. 

Note: The report records are sorted alphabetically.

112. 

Hide the marital_status column.

 

Click the marital_status column to view its column menu.

113. 

Point to the Format menu.

114. 

Click the Hide column menu item.

115. 

Note: The column is removed from the report.

 

 

Access the Format menu again to return the column to the report.

116. 

Point to the Save menu.

117. 

Note: The Save menu lets users maintain formatted versions of a report. There is no limit to the number of versions you create.

118. 

Click in the white space to close the menu.

119. 

Note: Task 3, Explore report interactivity in the report viewer, is complete.

120. 

Note: To learn how you can personalize and format a view and report, look at the module called Personalizing Reports through Interactivity, in the Using Jaspersoft BI course.

121. 

Click the Log Out link to exit JasperReports Server and end the session.

122. 

Congratulations!

 

You completed the following two tasks:

 

1. Design a Domain with the Domain Designer wizard

2. Create and save an Ad Hoc view and report based on the Domain

End of Procedure.