Creating the Report Book Framework
The first step is to create your report book jrxml, the framework in which you organize the book’s parts.
To create the report book framework:
|
1.
|
Open Jaspersoft Studio. |
|
2.
|
Click to open the Wizard selection window. |
|
3.
|
Expand the Jaspersoft Studio folder and select Jasper Report. Click Next. |
|
4.
|
In the Categories panel, select Report Books. |
|
5.
|
Click to select Wave Book. Click Next. |
|
6.
|
In the Report file window, Select the My Reports folder, and change the jrxml file name to Sample_Book.jrxml. Click Next. |
|
7.
|
In the Data Source window, select the data adapter you want to use. For our walkthrough, select Sample DB – Database JDBC Connection. |
|
8.
|
In the text pane, enter the following query: |
select distinct shipcountry from orders order by shipcountry
Then click Next.
|
9.
|
In the Fields window, select SHIPCOUNTRY from the Dataset Fields pane, and click ***arrow button***. Click Next. |
|
10.
|
In the Book Sections window, make sure all three options are selected: |
|
•
|
Create Table of Contents
|
|
•
|
Create Back Cover Section
|
Your Report Book project opens in Jaspersoft Studio.
In Jaspersoft Studio, open the Project Explorer and expand the My Reports folder. There, you can see the jrxml files you just created:
|
•
|
Sample_Book_backcover.jrxml |
|
•
|
Sample_Book_cover.jrxml |
This last file, Sample_Book.jrxml, is the file in which you will organize the report parts. It is open in the main Design tab.
Sample_Book.jrxml has three groups, for the different book part types:
|
•
|
Cover and Table of Contents, which contains Sample_Book_cover.jrxml and Sample_Book_toc.jrxml. |
|
•
|
Content, which is currently empty. |
|
•
|
Backcover, which contains Sample_Book_backcover.jrxml |
When you select each these book parts in the design window, you can view and edit their properties in the Properties View, as you can with standard reports and subreports.
Next, you will create a subreport and add it to your report book.