JasperreportIntroduction
Jasperreport is a report printing component and is one of the open source code organizations sf.net.
Java report printer. Jasperreport is suitable for reporting and printing components for web applications and Java applications. The key point is jasperreport.
It's free!
IreportSimplifiedIntroduction
Ireport is also a free software in sf.net, an open-source organization. Its main function is to design and generate data in a visualized manner.
The report format file used by jasperreport, because jasperreport itself does not provide a good visual report design tool, the emergence of ireport exactly makes up for this defect.
Download and install ireport Software
Not to mention, and start production.
1. Establish a connection
Set connection
To test the jdbc url, user name, password, and database settings, click test.
2. Create a template
Report Structure
Title: each report generally has a name, such as a sales report. title is the best place to hold the name. Of course, you can also put it in a proper place as needed.
Pageheader: some common elements of a report, such as page number, creation time, creator, and so on, which is a good choice.
Columnheader: the name of the column to be placed. Remember not to use column data.
Detial: place data that needs to be recycled, such as sales record data.
Columnfooter: statistical calculation value at the column level or description of the column.
Pagefooter: statistical value or page description at the page level.
Summary: The number of pages that may be counted. For example, 50 sales records occupy 3 pages, so the best place for storing these statistical records is summary.
3. Create an SQL query statement
4. Create a template
You can use the 'T' chart to add Unchanged text (such as report title) to the template, and use the 'F' icon to add the data fields to the template.
After the fields in the t_user table are drawn
After the template is created
Click "compile" at "à" to compile the template.
If the following information is displayed, the template is successfully compiled, indicating that the template has no layout and parameter errors.
After compilation is successful, you can click 'execute report (using dynamic connection) 'to generate a report based on the created template.
After the execution is successful, find the report file and view