Ireport is developed with JasperReport
1. Introduction: JasperReport is a report creation tool that must be written in an XML according to the rules it written, and then the report file you want to get the user. The JasperReport library is a flexible, powerful report generation tool that can generate reports in various forms such as PDF, HTML, or XML, and supports CSV, XLS, and other format reports. The engine is written by Java and supports a variety of form applications to generate dynamic reports. Printing report documentation, JasperReport is a data for the report in accordance with a predefined XML document, which is diverse, including relational database, Java container object, and later we will introduce, users implement data source and report engine through simple interfaces. usage of. First of all, the version of the IREPORT we used is: "Ireport 0.4.1"; JasperReport version is: "JasperReports 0.6.5". The current IReport supports version 0.6.6.6.6.6.6.0. And 0.6.4 version of the version. 1. The running environment JDK requires a minimum of 1.2.2 or higher. 2.JasperReport work mode (picture Source: http:/cap3.html# 3.1) After using Ireport design, get an XML file (ending at .jrxml), compile generation The Jasper file (ends with .jasper), it is ultimately to be compiled * .jasper files 3.IReport 3.1.1 will be decompressed after Ireport0.4.1 after decompression, there is a batch of "iReport.bat" File, double click to run it (Figure :). 3.1.2 The main interface after IREPORT runs as shown below:
3.1.3 Making a report based on the SQL Server database (a lot of static report making is available online, not explained here), first select the File menu (Figure 1), (Figure 1) Select New Document to create a new report (you can also Choose the Report Wizard Report Wizard to generate a report, now you don't talk about), you can also click on the icon to create a new report. 3.1.4 Real-in Report Attribute In the "Report Name" real report name, select the paper and size you want to use in the "Page Size" area, we choose the default parameters here, and many of the information on the Internet must modify "I18n" "XML Encoding" in the tab, change to "GB2312", the default parameter is "UTF-8", and Ireport does not provide this option, this option we did not modify it is still "UTF-8", if you It is necessary to manually enter "GB2312" manually. Then click OK. The main interface is changed to: 3.1.5 Setting up the data source, click "Datasource", select "Connections / DataSource", the following to the picture, click "New" Set the data source Click "New", pop up the picture box, set the connection properties (as shown :), select your data source ("Type of Connection / DDataSource", there is JavaBean, XML, JDBC and other data sources, We choose the JDBC data source, the data source name "name", you can enter your favorite name. In the "JDBC DRIVER" drop-down list box, select the database connection driver, we choose to connect the SQL Server class, connect the JDBC's URL, which will automatically fill you. Enter the server address in the "Server Address" input box. Fill in the database name you want to use in the "Database" input box. And fill in the user name "username" and password "password" that you log in to the database, then click Save Password "to save your password in the password input box. Click "Wizard" to update your login information to "JDBC URL", now we should make a connection test for the database, see if the settings correctly click "Test", if the test is successful, will pop up, otherwise The connection error dialog box is popped (Figure) At this time you have to check if your setting parameters are correct, with a secure login method of the database. During the end of the end of FAQ 1. When generating a report? JasperReport's Chinese processing, you must have an Asian language package "ITextasian.jar," to the lib directory under Ireport; then modify the "PDF font name" of the report to "Stsong-Light", then modify "PDF Embedded PDF Encoding "will be changed to" Chinese Simplified "so that JasperReport can solve the Chinese problem (for PDF settings, may have less to Excel, but this setting can also be displayed as Chinese, is not to be ignited).