Refining Your Report

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.

  1. Click the Select Objects icon () in the toolbar.
  2. Click in the grid and drag a selection box (from right to left), around all four fields in the Details band.
  3. Go to the Format menu and select Size & Border. The Format Element dialog box appears.
  4. In the Format Element dialog box, click All.
  5. Under Style, click solid.
  6. Next to Color, select black from the list.
  7. Next to Width, click the up arrow to select 1.
  8. Change the Paddings property to Left - 0; Right- 0; Top - 5; Bottom- 5.
  9. Click OK to exit the Format Element dialog box and apply your formatting changes.
  10. Click the PRODUCTLINE field to select it.
  11. Click the Structure tab and click bg-color (backbround color) under the Style tab.
  12. Click the Add Expression icon () next to bg-color. The Expression dialog box appears.
  13. Click the ellipsis (...) to open the Formula Editor dialog box.
  14. Select Logical from the Category drop-down box.
  15. Double-click the IF statement in the list on the left.
  16. Click the Select Field icon, (on the far right), next to the Test line.
  17. In the Select Field box, choose PRODUCTLINE and click OK to return to the Formula Editor.
  18. Add ="Classic Cars" to the Test line. Your condition should look like this: [PRODUCTLINE]="Classic Cars"
  19. In the Then_value line type red; in the Otherwise_value line, click white.
  20. 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.
  21. Drag and drop an Image element from the palette into the Report Header band.
  22. 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.
  23. Click Embed in Report and click OK.
  24. 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.
  25. Drag and drop a Date field element in the right corner of the Page Footer.
  26. 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.
  27. Drag and drop a Chart element from the palette to the Report Footer band.
  28. Use the resizing handles to center and stretch the chart. You can also adjust the width of the band.
  29. Double-click the sample chart. The Edit Chart dialog box opens.
  30. 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.
  31. In the chart-title text box, type, Highest Cancelled Order Costs.
  32. On the right, next to value-column, select TOTALPRICE from the list. This column determines the numerical data that the pie chart will represent.
  33. Next to series-by-field, click the ellipsis (...) to open the Edit Array dialog box.
  34. Click Add and double-click in the white area under Value.
  35. 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.
  36. 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.
Your report should look something like this.