Developing Web Reports using Pentaho report
1. Document Description
Java Open source reporting software, Pentaho report is relatively good, to meet the majority of applications, and domestic business reports comparable; now record the actual Development Report complete process tutorial, let beginners quickly get started and apply to the project.
2. Development environment Description
1) Tool Environment: Pentaho report designer5.3, Tomcat6, Jdk6, Eclipse Java EE (4.3)
2) MySQL and sample database Saikla
3) MySQL driver copy to Report_home\lib\jdbc folder
4) Configure the report environment Jndi
Jndi is used in order to use the connection pool configuration when the Web project is integrated;
The. pentaho/simple-jndi/default.properties file adds Jndi configuration information; the. Pentaho directory is home or the user directory that runs the Report Designer program.
The sample configuration reads as follows:
Sakila/type=javax.sql.datasource
Sakila/driver=com.mysql.jdbc.drivers
Sakila/user=root
Sakila/password=a123
Sakila/url=jdbc:mysql://localhost:3306/sakila
3. Developing reports in the designer
After the completion of this tutorial report, showing such as:
3.1 Configuring database connections
Jndi names are the same as those previously configured; test cost, confirm save.
3.2 Defining a DataSet query
The SQL in the query section can be generated graphically or copied directly, and click Preview to verify that the statement is correct. Complete and right-click Query results are shown below:
3.3 Defining functions
Right-click New function on function node, sumamount, Countcustomer pageofpagesfun. Sumamount needs to indicate the sum field.
The summary is a global class, and the running class is run-time evaluated, depending on the grouping or segment.
3.4 Designing a report area segment
The details section is automatically scaled down according to the records, and the other segments are displayed only once or once for each grouping. If the segment is hidden in the designer, right-click in the structure diagram to unhide it.
Sets the grouping field and the control value, where the value of the message control is: $ (first_name), $ (last_name), and the other controls are dragged from the data set.
You can also set values or formulas for control properties, such as the following:
Developing Web Reports using Pentaho report