Ireport + jasperreport create report 1-template Creation

Source: Internet
Author: User

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


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.