Creating a Basic Report

Make sure the HQLDB (Hypersonic) Sample Database is running before you start this exercise. Go to Start -> Pentaho Enterprise Edition -> Server Management -> Start Sample Database. Alternatively, if you used the installer, you can start HSQLDB by navigating to .../pentaho/server/hsql-sample-database and clicking start_hypersonic.bat (or .sh). If you installed the BI Suite from a .zip or .tar.gz file, navigate to .../biserver-ee/data and click start_hypersonic.bat (or .sh).

As an introduction to Report Designer, follow this procedure to create a simple report that shows which products are associated with cancelled orders, sorted by product line and territory.

  1. From the Welcome screen, click the Evaluation Blank Report under Samples.

    The report appears in the Design view. The Design view enables you to create and adjust the report layout manually.

    The sample report file you just opened was designed specifically for this evaluation guide. It comes with a predefined data source linked to the sample data included in the evaluation package. The only element in this report is a header at the top that says "Pentaho Report Designer Walkthrough Sample Report." You can remove this header if you like.

  2. Drag and drop a Label element from the Palette onto the Page Header band. The page header appears at the absolute top of every page in the report.
  3. Double-click the label to edit it, then type in Cancelled orders for all regions.
  4. Click the font size drop-down box in the formatting toolbar, and select 24 in the list. This increases the text size to 24 point, which is more appropriate for a page title than 12 point.
  5. Click and drag the horizontal resize handles on the Label element you just created until the field is as large as the page; drag the vertical resize handles until the text fits appropriately in the space. Expanding the field out to the size of the page will allow you to center the text more easily.
  6. With the label selected, click the Center Aligns the Element icon in the formatting toolbar. The text is now perfectly centered in the page header.
  7. Click the Data tab and click Data Sets.
  8. Click and expand the JDBC (SampleData) folder.
    Note: Click the small icon to the left of the JDBC (SampleData) folder. Click the icon next to the small icon to the left of the default folder.
    The TERRITORY, STATUS, PRODUCTNAME, PRODUCTLINE, and TOTALPRICE fields are listed.
  9. Click TERRITORY to select it, then click and drag it into the left side of the Details band section of the grid. The Details band will repeat itself for as many iterations of the query elements as there are. So if TERRITORY contains five rows, there will be five item elements in the report, spread across as many pages as is necessary.
  10. Repeat the previous step for the PRODUCTLINE column, but drop it into the center of the Details band instead.
  11. Repeat the previous step for the PRODUCTNAME column, but drop it into the right side of the Details band instead.
  12. Drag the TERRITORY field to the absolute top left of the Details band.
  13. Drag the PRODUCTLINE to the absolute top center of the Details band, then click the Center Aligns the Element icon in the formatting toolbar.
  14. Drag the PRODUCTNAME to the absolute top right of the Details band, then click the Center Aligns the Element icon in the formatting toolbar.
  15. Drag the TOTALPRICE to the absolute top right of the Details band, then click the Right Aligns the Element icon in the formatting toolbar.
  16. Drag the resize handles on the TERRITORY, PRODUCTLINE, PRODUCTNAME, and TOTALPRICE fields so that they fill all of the horizontal space in the grid. Don't change their vertical size — just adjust their horizontal borders and orientations so that they are at the top of the Details band with their borders abutting to one another and the sides of the report, ensuring that none of them overlap. The three fields should appear to be one solid line when you're done resizing and repositioning them.
    CAUTION:
    Make sure elements do not overlap; if they do, they may not appear in the output.
  17. Click Preview icon (it looks like an eye) in the upper left corner of the formatting toolbar. Preview is a good way to verify the effects of any changes you make to a report.
  18. Go to File -> Save and save your report
You now have a basic report that shows information that would be quite useful to the fictional company it belongs to. If you'd like to see some of Report Designer's more advanced functionality, continue on to the next section. Otherwise, skip ahead to the next portion of this guide that appeals to you.
Your report should look similar to the one shown here.