Time for action – creating a new report
We will create a new report from scratch. In order to do this, we will need to create the report itself, then create a JDBC-type data set and establish its SQL query. Finally, we will create a general layout, which means we will need to add to our report a series of objects and configure them properly.
We will create a new report and save it under the name,
07_Adding_Parameters.prpt
.We will create the following layout for our report:
At this stage, we need to create a JDBC-type data set, establish the connection with our sakila database, and then create the following query:
SELECT film.rating, film.title, SUM(payment.amount) AS sum_amount, COUNT(1) AS count_rental FROM payment INNER JOIN rental ON rental.rental_id=payment.rental_id INNER JOIN inventory ON inventory.inventory_id=rental.inventory_id INNER JOIN film ON film.film_id=inventory.film_id WHERE film.rating IN ('G','PG','PG-13','R','NC-17') AND YEAR(payment.payment_date) = 2005 AND MONTH(payment_date...