【Introduction to JasperReports】

JasperReports is a Java-based open source reporting tool, which can make reports in the Java environment like other IDE reporting tools. JasperReports supports PDF, HTML, XLS, CSV and XML file output formats. JasperReports is currently the most commonly used reporting tool for Java developers.

 

characteristic

The report template of JasperReports can be made with tools such as iReport. As long as the report is stored in XML format, it can be read by JasperReport, and then compiled into a .jasper file.

JasperReports is the world's most popular open source reporting engine. It is written entirely in Java, it is able to consume data from any type of data source, and generate pixel-level documents that can be viewed, printed or exported in a variety of document formats, including HTML, PDF, Excel, OpenOffice and doc .

 

 

Using JasperReports, data can be filled on the basis of pre-formatted reports, and reports in various formats can be exported.

The following diagram illustrates the basic steps of JasperReports report generation:



 

 

1. The file with the extension .jrxml is a standard xml file, which defines the format and data composition of the report. This file can be generated and edited visually through iReport, the "golden partner" of jasperReports.  

2. After the jrxml file is compiled by the JasperReports API, a binary file with the extension .jasper will be generated.  

3. You can call the JasperReports API to fill in the data and parameters for the jasper file, and generate a file with the extension .jrprint.  

4. Call the JasperReports API to finally export the jrprint file into PDF, Excel, Html and other formats.      

The following will use iReport + JasperReports to generate the PDF format report as shown below. The data in the table comes from the database and is filled by JasperReport on the basis of the fixed format report.

The entire report generation process requires two steps: 

1. Use iReport to generate a jrxml file that specifies the report format and data composition.  

2. 调用JasperReports API 编译、填充并导出固定格式的报表。  



 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326338660&siteId=291194637