JasperReports report development consists in three steps:
Report Design
Report Compilation
Report Preview
These steps are repeated until the desired result is obtained. This chapter gives a detailed explanation for each of the presented steps.
This section explains the activities involved in the design of a report. Before proceeding to this section please ensure that you are familiar with the structure of a JasperReports report. (see Chapter 6, Report Structure).
To add a style you have to perform the following steps:
To add a font you have to perform the following steps:
To add a parameter you have to perform the following steps:
To add a field you have to perform the following steps:
Procedure 7.4. Adding a field
Open the Outline View
if necessary.
Locate the Fields
node in the Outline
View
.
Right-click on the Fields
node and select Add
Field
from the context menu.
Edit field properties in the Properties View
.
For certain data source types such as Database Data Source and Custom Data Source, fields can be auto-discovered by analyzing the information provided by the data source. This can be achieved by using the Field Wizard provided by JasperAssistant.
To start the wizard, right-click on the Fields
node in the
Outline View
and select the Field
Wizard...
option from the context menu.
Procedure 7.5. Field Wizard steps
Data Source selection
This step allows you to select a data source from the list of data sources that support the field introspection.
SQL query specification
This step is available only for database type data sources. It allows you to specify or adjust the SQL query that will supply the data for the report. For a custom data source type this step is skipped. Enter the query and press
button to proceed to the next step.Field selection
This step allows you to adjust the data source fields used by the report. After selecting the desired fields, choose the
button to update the report.To add a variable you have to perform the following steps:
To add a group you have to perform the following steps:
To add a sub-dataset you have to perform the following steps:
To add a report section you have to perform the following steps:
Procedure 7.9. Adding a report section
Open the Outline View
if necessary.
Locate the root or a group node in the Outline View
.
Right-click on the root or group node and select Add
Band
sub-menu from the context menu.
In the Add Band
sub-menu select the menu item for the
desired section type.
Edit section properties in the Properties View
.
To add a report object you have to perform the following steps:
Procedure 7.10. Adding a report object
Locate the Palette View
.
Select the desired object in the Palette View
.
Click in the Designer Editor inside a report section to create the object. Alternatively, holding the mouse button, drag an outline box and then release the button to create the object.
Edit object properties in the Properties View
.