Pentaho 5.0 Reporting by Example
上QQ阅读APP看书,第一时间看更新

Time for action – exporting in different formats

Next, we will see how to present the report we just created by exporting it to different formats:

  1. Press on the Time for action – exporting in different formats icon found in the shortcut bar. In this case, we choose PDF:
  2. Now press on the Time for action – exporting in different formats icon and choose HTML:
  3. Press on the Time for action – exporting in different formats icon and choose Excel (or Excel 2007).

What just happened?

We exported our report to different formats, that is, to PDF, HTML, and Excel/Excel 2007.

Have a go hero

Now that we have made our first report, it is time for you to put into practice what we have been learning. We propose that you make some small modifications to the 01_Hello_World.prpt report so that it looks as follows:

The steps you should perform, broadly speaking, are as follows:

  1. Save the report with the name 01_Hello_World_Plus.prpt.
  2. Edit the ZoneProductQty data set, adding the Type column with its corresponding values.
  3. Create a function that returns the average of the quantities sold, that is, that calculates it based on the Quantity field.

Pop Quiz – data sets, functions, and objects

Q1. Which of the following affirmations is true?

  1. The Table data set uses a table of our database.
  2. We can create a data set by extracting data from a spreadsheet.
  3. To assign a value to a label to display it, we have to configure Style.value.
  4. The RowBanding function can give background colors to the rows in the Details section, but always alternately coloring the rows.
  5. The Image object allows either embedding an image in the report or taking it from a path.
  6. The Print Preview option shows the report in the HTML format by default.