Personalizing Reports through Interactivity Activity

 

 

 

Step

Action

1. 

Using the previous lab as a guide, deploy to the Public folder the EmployeeInformation.jrxml report you created in an earlier activity.

2. 

Note: Reports designed with the iReport Table component and viewed in JasperReports Server allow you to move, hide, and adjust the width of columns. Click to update the font family, text size and color, and alignment for both column headers and data fields. Use multi-column filtering and sorting to display the records you need in the order you want.

 

Personalize your report with on-the-fly data formatting, filtering, and sorting. One report can be formatted and saved as different versions. The interactivity helps each user personalize a report according to their unique needs.

3. 

Log into JasperReports Server as joeuser / joeuser.

4. 

Begin by opening the report and formatting the salary and hire date fields.

 

Click View > Repository and then the Public folder to find the Employee Information report, then click to execute the report.

5. 

Note: The report, titled Employee Information, appears in the Interactive Viewer.

6. 

Click the Salary column header to display the column menu.

7. 

Note: The column menu appears.

8. 

Point to the Format menu.

9. 

Click the Formatting menu item.

10. 

Note: The Format column window appears.

11. 

Note: Separate tabs allow formatting of the column headings and the column values.

12. 

Note: In the Headings pane, you can change the heading text, specify its font and size, specify style and alignment, and choose its text color.

13. 

Click the Values tab to view the column values pane.

14. 

Note: Because the Salary column displays numeric information, options include the appropriate format patterns at the lower left.

15. 

Note: Number format and currency symbols are also available.

16. 

At the lower left, click the (1234) list item to specify a format pattern.

17. 

Click the Currency menu at the lower right to view the symbols.

18. 

Click to select the USD dollar symbol.

19. 

Under Number format, click the comma to serve as the thousands separator.

20. 

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

21. 

Note: Salary values are formatted as you specified.

22. 

Now, format the column header and date values of the Hired column.

 

Click the Hired column header.

23. 

Point to the Format menu.

24. 

Click the Formatting menu item.

25. 

Click in the Heading text field to delete the current value.

26. 

Add the new column header text.

 

Enter Hire Date into the Heading text field.

27. 

Note: The new header label appears in the report after the OK button is clicked.

28. 

View the values pane to format the date field.

 

Click the Values tab.

29. 

Click the dd/mm/yy pattern to select it. Alternatively, you can type the pattern directly into the Format pattern field.

30. 

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

31. 

Note: The column label is updated and dates are formatted to your specification.

32. 

Next, format the text of the seven column headers and data fields.

 

Click the First column header to view the column menu.

33. 

Point to the Format menu.

34. 

Click the Formatting menu item.

35. 

                                                                                                                      Note: Display the column header in a font of your choice with size 14, bold, dark green text.

36. 

In the Size field, click the 14 list item.

37. 

Click the Bold button.

38. 

Click the Color list.

39. 

Select the Dark Green cell at the bottom of the fifth column from the left. 

40. 

Note: Header formatting takes affect after the OK button is clicked.

41. 

Now, format the text of employees' first names.

 

Click the Values tab.

42. 

Choose a font.

43. 

In the Size field, click the 12 list item.

44. 

Click the Color list.

45. 

Select the same Dark Green cell.

46. 

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

47. 

Note: The First column header and field values reflect the new formatting.

48. 

Note: Now, optionally format the remaining columns to match. Columns are formatted one at a time, so do this only if you want to.

49. 

Next, hide the marital status column.

 

Click the Status column header to view the column menu.

50. 

Point to the Format menu.

51. 

Click the Hide column menu item.

52. 

Note: The Status column is removed from the table layout. To return a column to the report, click any column header to view the Format menu and the Show columns menu choice.

53. 

Now, add space between the Education and Title columns.

 

Click anywhere in the Education column to select it.

54. 

Note: Greater separation appears between the two columns.

55. 

Next, move the Salary column to the left of the Hire Date column.

 

Click to select the Salary column and display the column menu.

56. 

Note: With the column selected, click anywhere in the column and drag it to the left.

57. 

Note: When the border slider appears in the correct position, release the mouse.

58. 

Click and drag the Salary column to the left of Hire Date.

59. 

Note: Salary appears to the left of Hire Date.

60. 

The Undo and Redo buttons at the top right allow quick access to your edit history.

 

Click the left-arrow Undo button.

61. 

Note: The most-recent action is undone, and the two columns return to their original positions.

62. 

Click the right-arrow Redo button.

63. 

Note: The two columns switch places.

Task 1: Personalize and format a report, is complete.

64. 

Note: The name of the report displays in blue text at the upper left, along with the date and time it was last refreshed.

65. 

Save this version of the report formatted to your specification.

 

Point to the Save menu.

66. 

Click the Save As menu item, the diskette icon in the toolbar on the upper right.

67. 

Note: The Save As window appears.

68. 

Click in the Name field to insert the cursor after the text there.

69. 

Enter -v1 into the Name field.

70. 

Expand the Organization folder.

71. 

Click to select the Reports folder.

72. 

Click the Save button to save this version of the report.

73. 

Note: Task 2: Save the report, is complete.

74. 

Note: The name of the new version appears in the upper-left corner of the Interactive Viewer.

75. 

Next, explore filtering and sorting to segment the report and view specific information.

 

Create filters on the Education and Title columns to identify store managers who have earned a Bachelors Degree.

 

Click the Education column header to display the column menu.

76. 

Create a filter that allows records of only employees with a Bachelors Degree to display in the report.

 

Click the Column filters button.

77. 

Note: The Filter column window appears.

78. 

Note: To delete an existing filter, click the first radio button. To configure a new filter, click the second button.

79. 

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

80. 

Click the filter operators list to view all available operators.

81. 

Click the Contains list item.

82. 

Enter Bachelors into the filter text field.

83. 

Note: This filter identifies values of the Education field that contain the word Bachelors.

84. 

Click the OK button to add the filter.

85. 

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

86. 

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

87. 

Configure a second filter to identify all store managers.

 

Click the Title column header.

88. 

Click the Column filters button.

89. 

Click the Show only rows where option to create a new filter.

90. 

Note: The default filter operator is Equals.

91. 

Enter Store Manager into the filter text field.

92. 

Click the OK button to add the filter.

93. 

Note: Together, the two filters constrain the report to display records for store managers who have earned a Bachelors Degree. Multiple filters are a powerful tool for segmenting your reports to find specific information.

94. 

Now, edit the Education filter to identify employees with a partial college education.

 

Click the Education column header.

95. 

Click the Column filters button.

96. 

Click the filter operators list.

97. 

Click the Equals list item.

98. 

Click in the filter text field to delete the current value.

99. 

Enter Partial College into the filter text field.

100. 

Click the OK button to save changes and modify the filter.

101. 

Note: The report now displays the records of store managers with a partial college education.

102. 

Now, remove both filters and return the report to its default view.

 

Click the Education column header.

103. 

Click the Column filters button.

104. 

Click the Show all rows option.

105. 

Click the OK button to save changes and delete the filter.

106. 

Note: The Education column is no longer filtered.

107. 

Remove the Title filter.

 

Click the Title column header.

108. 

Click the Column filters button.

109. 

Click the Show all rows option.

110. 

Click the OK button to save changes and delete the filter.

111. 

Note: The filters are removed and the report displays all records.

112. 

Next, sort the report by salary to view information on the lowest- and highest-paid employees.

 

Click the Salary column header.

113. 

Click the Sort ascending button.

114. 

Note: The ascending sort icon appears in the column header and report records are sorted in order of increasing salary.

115. 

Now, reverse the sort to view the highest-paid employees.

 

Click the Salary column header.

116. 

Click the Sort descending button.

117. 

Note: The descending sort icon appears and report records are displayed in order of decreasing salary.

118. 

Remove the sort.

 

Click the Salary column header.

119. 

To remove a column sort, click the sort icon that matches the current sort.

 

Click the Sort descending button.

120. 

Note: The salary sort is removed and the report displays its records in default order.

121. 

Next, configure concurrent sorts on last name and hire date to identify employees who share last names and were hired at the same time.

 

Click the Last column header.

122. 

Click the Sort ascending button.

123. 

Note: Records are sorted by last name in ascending alphabetical order.

124. 

Configure sorting on the hire date.

 

Click the Hire Date column header.

125. 

Click the Sort ascending button.

126. 

Note: The records with last name Adams indicate that the report displays records ordered by last name and then by hire date.

127. 

Now, remove the hire date sort.

 

Click the Hire Date column header.

128. 

Click the Sort ascending button to remove the sort.

129. 

Note: The report remains sorted by last name.

130. 

Next, combine filtering and sorting to identify employees with a partial college education who were hired before 1996.

 

Click the Education column header.

131. 

Click the Column filters button.

132. 

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

133. 

Click the filter operators list.

134. 

Click the Contains list item.

135. 

Enter College into the filter text field.

136. 

Click the OK button to add the filter.

137. 

Note: Records are displayed only for employees with a partial college education.

138. 

Configure a second filter on hire date.

 

Click the Hire Date column header.

139. 

Click the Column filters button.

140. 

Click the Show only rows where option.

141. 

Click the filter operators list.

142. 

Click the Is before list item.

143. 

Click in the filter text field.

144. 

Note: Configuring a date filter opens the calendar tool. You can click through the calendar to select a date, or enter the date manually into the text field.

145. 

Add the date manually.

 

Enter 1996-01-01 into the filter text field.

146. 

Click the OK button to add the filter.

147. 

Note: The report displays records of employees with a partial college education who were hired before 1996. Records are sorted alphabetically by last name.

148. 

Note: Task 3: Filter and sort to segment the data, is complete.

149. 

Next, save this version of the report.

 

Point to the Save menu.

150. 

Click the Save As menu item.

151. 

Click in the Name field to delete the -v1 text.

152. 

Enter -v2 into the Name field.

153. 

Note: JasperReports Server remembers the folder in which you last saved the report.

154. 

Click the Save button to save version 2 of the report.

155. 

Note: A second version of the report is saved to the repository.

 

Task 4: Save the updated report, is complete.

156. 

Click the Back button to close the report and return to Repository view.

157. 

Congratulations!

 

You completed the following four tasks:

 

1. Personalize and format a report

2. Save the report

3. Filter and sort to view specific information

4. Save a second version of the report

End of Procedure.