Now we will open the previously created report and save it with a different name. This copy shall serve as the base report, which we will use throughout this chapter. Later we will create a new data set of JDBC type.
01_Hello_World.prpt
report from the PRD UI. To do so, click on the icon from the Shortcuts menu, and search for the report 01_Hello_World.prpt
; select it, and click on the OK button.
03_Adding_Relational_DS.prpt
.By default, PRD brings a series of example data sets. To see these connections in detail, we can go to the following folders:
/home/userName/.pentaho/report-designer/user/org/pentaho/reporting/ui/datasources/jdbc/Settings
C:Documents and SettingsuserName.pentaho
eport-designeruserorgpentaho
eportinguidatasourcesjdbcSettings
sakila
database. To do so we will select the option and complete the newly opened form with the following data:
sakila db
MySQL
Native (JDBC)
localhost
sakila
3306
root
root
CountryCustomerAmount
. Finally, in the Query section, we will copy the following query:
SELECT country.country, customer.first_name, customer.last_name, SUM(payment.amount) sum_amount 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 GROUP BY payment.customer_id ORDER BY country.country LIMIT 0,30
PRD supports simultaneous data sets on the same report, but only one of them can be selected to be used in the report. At this point, we have two data sets available in our report, but ZoneProductQty is selected.
We just opened the previously created 01_Hello_World.prpt
report and saved it with a different name: 03_Adding_Relational_DS.prpt
. We created a JDBC-type data set and defined the connection to our sakila
database. Then we created a new query and performed a preview on the data. We also discarded the old data set and selected the new one.