To complete this process, you must have created a report according to the
directions in the previous section. You should have the modified evaluation_blank.report file open in Report Designer at this
time.
Being able to view properly refined and constrained data is useful, but Report
Designer is capable of much more than just collecting and printing data; it also has
many formatting options to increase the readability and visual appeal of your
reports. Follow the below process to enhance your report with conditional
formatting, borders, a company logo, a dynamic report date in the footer, and a pie
chart. Feel free to go to the Preview tab at any time to see your progress.
-
Click the Select Objects icon (
) in
the toolbar.
-
Click in the grid and drag a selection box (from right to left), around all
four fields in the Details band.
-
Go to the Format menu and select Size & Border.
The Format Element dialog box appears.
-
In the Format Element dialog box, click All.
-
Under Style, click solid.
-
Next to Color, select black from the list.
-
Next to Width, click the up arrow to select 1.
-
Change the Paddings property to Left - 0; Right- 0; Top - 5; Bottom-
5.
-
Click OK to exit the Format Element dialog box and apply your formatting
changes.
-
Click the PRODUCTLINE field to select it.
-
Click the Structure tab and click bg-color (backbround color)
under the Style tab.
-
Click the Add Expression icon (
) next to bg-color.
The Expression dialog box appears.
-
Click the ellipsis (...) to open the Formula Editor dialog box.
-
Select Logical from the Category drop-down box.
-
Double-click the IF statement in the list on the left.
-
Click the Select Field icon, (on the far right), next to the Test
line.
-
In the Select Field box, choose PRODUCTLINE and click OK
to return to the Formula Editor.
-
Add ="Classic Cars" to the Test line.
Your condition should look like this: [PRODUCTLINE]="Classic
Cars"
-
In the Then_value line type red; in the Otherwise_value
line, click white.
-
Click OK to exit the Formula Editor dialog box; click Close to
exit the Expression dialog box.
Click Preview (
). Notice that
all cancelled orders in the Classic Cars product line will now be highlighted in
red.
-
Drag and drop an Image element from the palette into the Report
Header band.
-
Double-click the image element to display the Resource dialog box. Click
(...) to browse for the logo.png file located in the Legacy folder
under samples (.../report-designer/samples/Legacy).
This graphic is a Steel Wheels Inc. logo developed by Pentaho for
demonstration purposes.
-
Click Embed in Report and click OK.
-
Reposition and resize the logo until it is the width of the report.
Report Designer will downsize images proportionately according to the size of
the element. You may not see the image until you resize it.
-
Drag and drop a Date field element in the right corner of the Page
Footer.
-
Double-click the new date field, and type and select Report date for a
field name.
Note: Click Preview to see the date displayed at the bottom
of the report.
-
Drag and drop a Chart element from the palette to the Report
Footer band.
-
Use the resizing handles to center and stretch the chart. You can also adjust
the width of the band.
-
Double-click the sample chart.
The Edit Chart dialog box opens.
-
The type of chart most appropriate for your report is a pie chart. In the top
portion of the Edit Chart dialog box, select the pie chart icon.
Note: Notice that the pie chart properties that define its
look-and-feel are listed in the left pane of the Edit Chart dialog box.
Properties associated with the data in the chart are listed in the right
pane.
-
In the chart-title text box, type, Highest Cancelled Order
Costs.
-
On the right, next to value-column, select TOTALPRICE from the
list.
This column determines the numerical data that the pie chart will
represent.
-
Next to series-by-field, click the ellipsis (...) to open the Edit
Array dialog box.
-
Click Add and double-click in the white area under Value.
-
Select PRODUCTLINE from the list and click OK to exit the Edit
Array dialog box.
This determines how the TOTALPRICE data will be constrained in the pie
chart.
-
Click OK to save the chart settings.
Your report is now branded for the fictional Steel Wheels company, easier to
read, and specifically highlights cancelled orders relating to the Vintage Cars product
line. This is still only the beginning, but you should now have a good impression of the
power and flexibility of Pentaho Report Designer.