Java open-source reports jasperreport and ireport4.5.1 (5) Table Components

Source: Internet
Author: User

Java open-source reports jasperreport and ireport4.5.1 (5) Table Components

After learning in the previous chapter, you have mastered the basic use of ireport.

This section describes how to use some useful components. One is table and the other is crosstab ).

. Table usage.

① Drag the table component into the report ,:

 

Examples are as follows:

In the summary section, the table is displayed!

② Create a dataset and set the number of columns in the table

 

 

Next step

 

There are two options: You can manually enter an SQL statement or design a query statement to design a query statement.

:

 

 

Next, select the required fields,

 

Select the group information. You can also add the group information when designing the report later.

 

 

Since then, dataset has been set up! :

 

 

 

After clicking finish, the table 1 tab is automatically displayed,

The page is as follows:

 

Switch to the table 1 Tab

③ The table designed.

There is a statistical field at the end,

Is to count all the number of people in each unit, the method is as follows, expression is as follows:

 
 
  1. $F{unitAthleteView_manAthlete}+$F{unitAthleteView_femalAthlete}+$F{unitAthleteView_guide}+$F{unitAthleteView_coach}+$F{unitAthleteView_teamDoctor} 

Note: by default, the table does not have borders. To add borders, manually add borders as follows:

Select All static text and text
Field,

Right-click padding Add Borders

Set the following parameters.

 

The preview result is as follows:

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.