Reader small image

You're reading from  Pentaho 5.0 Reporting by Example: Beginner's Guide

Product typeBook
Published inAug 2013
PublisherPackt
ISBN-139781782162247
Edition1st Edition
Tools
Right arrow
Author (1)
Right arrow

Starting practice


In this chapter we will copy a report we created earlier and modify it step-by-step so that it ends up looking like the following screenshot:

This report will have the feature that, when we click on the name of a country, a new report will open with more detailed information about that country. We will also configure the pie chart so that when we click on one of its areas, a report will open with more information about the selected item.

In the report detail, we will add two sparklines that will analyze the payment history tendency of each client.

First we will talk about hyperlinks, then about sparklines.

Time for action – configuring the layout


In the following section, we will make a copy of a report created in the previous chapter and configure its layout according to the needs of this chapter.

  1. We create a copy of the report we created earlier. Open the report 05_Adding_Groups.prpt and save it with the name 15_Adding_Hyperlinks_Sparklines.prpt.

  2. We modify the report so that it looks like the following screenshot:

    • In the Report Header section, we assign the following value to the Attributes.value property of the label: Adding Hyperlinks & Sparklines.

    In the Group Header section, we leave a blank space where we can add a Sub-report later.

    • In the Details Header section, we move the labels Customer and Amount to the left-hand side and add a label to show the value Trend.

    In the Details section, we eliminate the horizontal line and move the two objects found here to the left so that they stay below their respective headers. We increase the width of this section, as we will later place a Sub-report...

Learning about sparklines


Sparklines are very small graphics that contain very specific information. Sparklines have few characteristics to configure and are very minimalist. They cannot include axes, labels, descriptions, effects, or numbers. To get a better idea of what sparklines are, here are some examples:

As you can see, they do not contribute any information out of context. That is why their principal role is to accompany the data present in the report, and because of their small size, we can include them in the detail level of our reports!

PRD lets us include sparklines in our reports, granting us the possibility of analyzing the variation of an item's value over time, making specific comparisons, showing what percentage of a total an item's value represents, and so on.

If we compare sparklines with the kinds of charts that we have already seen in PRD, we could erroneously conclude that sparklines display very little information to the end user. But as we saw before, this characteristic...

Time for action – creating our first sparkline


We will modify our principal data set to practice each of the following points. We will create a subreport, and within it we will create and configure two sparklines.

  1. We modify the SQL query of our data set to conform to the needs of this guide. We add the field customer_id at the end of the list of fields in the SELECT statement. Our query should look like the following:

      SELECT country.country_id, country.country, customer.first_name,customer.last_name, SUM(payment.amount) sum_amount, payment.customer_id
      FROM payment 
      INNER JOIN customer ON customer.customer_id=payment.customer_id
      INNER JOIN address ON address.address_id=customer.address_id
      INNER JOIN city ON city.city_id=address.city_id
      INNER JOIN country ON country.country_id=city.country_id
      WHERE country.country_id IN (20,24,29,34,48,67,74)
      GROUP BY payment.customer_id
      ORDER BY country.country, customer.first_name

    In the Details section, beside the label Trend, we place a...

Summary


We created a copy of the report 05_Adding_Groups.prpt and modified its layout.

We explained what a hyperlink is, how to use it, and what it is used for. We talked about the different types of hyperlinks that can be created in PRD. We detailed the interaction between PRD and the Pentaho BA Server when using hyperlinks.

We created a hyperlink on a text-field that returns the value of the field country. We configured this hyperlink to open the report 13_Adding_Subreports.prpt and passed it the desired country as a parameter.

We explained how and where the information related to Hyperlinks is saved and analyzed the DRILLDOWN function.

We added a subreport to the Report Header Section and configured it and added a pie chart to it. We configured a hyperlink on this pie chart, so that clicking on each portion of the pie chart shows the report 09_Using_Formulas.prpt filtered by the value of the selected portion.

We explained what sparklines are and what they are used for. We explained the characteristics...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Pentaho 5.0 Reporting by Example: Beginner's Guide
Published in: Aug 2013Publisher: PacktISBN-13: 9781782162247
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime