Java Open Source Report Jasperreport, iReport4.5.1 use detailed (five) Table component
Through the previous chapters of the study, has a preliminary grasp of the basic use of ireport.
This section describes the use of several particularly useful components. One is table (table), one is crosstab (cross table, next section).
. Use of tables.
① Drag the table component into the report, as shown in the figure:
I use the following examples:
In the Summary section, the table is displayed.
② new DataSet, set number of columns for table
Next
There are two options for you to manually enter the SQL statement, or you can design query, which will be designed for you.
As shown in the figure:
Next, choose the fields you want,
Select the grouping information, or you can add it later when you design the report.
Since then, the dataset has been set up. As shown in the figure:
After the click is complete, automatically jumps to the Table1 tab,
The page looks like this:
Switch to Table 1 tab
③ designed the table as shown in the picture.
There's a statistic field at the back,
is to count all the numbers in each unit, as follows, expression as follows:
$F {unitathleteview_manathlete}+ $F {unitathleteview_femalathlete}+ $F {unitathleteview_guide}+ $F {unitAthleteView_ coach}+ $F {Unitathleteview_teamdoctor}
Note: The default, the table is not a border, if you want to add a border, please add a border: The following:
Select all the static text and text Field,
Right-click to select padding Add Borders
You can set the following parameters.
The final preview effect is as shown: