OpenReports Training material for Development Team
Abstract
Purpose of this presentation are:
Helping development team know about OpenReports,
JasperReports. Helping development team get acquainted with how to make a report.
It is mainly described in 6 sections:
What is JasperReports? JasperReports – An Example Recommended tools for JasperReports What is OpenReports? OpenReports usage Practice
Outline
What is JasperReports?
JasperReports – An Example Recommended tools for JasperReports What is OpenReports? OpenReports usage Practice
What is JasperReports?
It is libraries used to generate some types of report: PDF, HTML, RTF, XLS… It is an open source reporting engine. It can be used for Web or desktop application.
What is JasperReports?
To generate a report, we need: Jasper Report libraries, including: • jasperreports-*.jar • commons-beanutils-*.jar • commons-collections-*.jar • commons-digester-*.jar • commons-logging-*.jar • Itext*.jar Report design file *.jrxml
Steps to generate a report
Step 1: Design a report in a .jrxml file.
We can design it manually but it’s better to use tools like iReport or JasperAssistant.
Step 2: compile the report design. Note: a *.jasper file or an instance of JasperReport class is often created after this step. Step 3: get connection from a Database
Steps to generate a report (cont.)
Step 4: Fill the compiled report design with data and produce the *.jrprint file, or create an instance of JasperPrint Step 5: Create the report file.
Outline
What is JasperReports?
JasperReports – An Example
Recommended tools for JasperReports What is OpenReports? OpenReports usage Practice
JasperReports – An Example
JasperReports – An Example (cont.)
JasperReports – An Example (cont.)
JasperReports – An Example (cont.)
Outline
What is JasperReports? JasperReports – An Example
Recommended tools for JasperReports
What is OpenReports? OpenReports usage Practice
Recommended tools for JasperReports
Normally, we don’t design JasperReports manually by ordinary text editor. Some report designer tools can be used to generate *.jrxml files and create the report: JasperAssistant iReport
Recommended tools for JasperReports iReport
Sample report layout:
Recommended tools for JasperReports iReport
To create a connection: Go to main menu-> Data>Connections/Data Sources.
Recommended tools for JasperReports iReport
To get fields from a database: Go to Edit-> Report Query
Recommended tools for JasperReports iReport
Recommended tools for JasperReports iReport Variable: is calculated based on fields at run time. Parameter: Each report has report parameters, or report inputs. They are supplied at run time. We can design report layout by drag/drop fields/variables/parameters into the design screen. We can add/edit variables and parameters.
Recommended tools for JasperReports – iReport
To support Unicode character, change font parameters as in the image.
Recommended tools for JasperReports iReport
To compile a report: Go to Build-> Compile. To view a report: Go to Build-> Execute (with active connection).
Recommended tools for JasperReports iReport
Outline
What is JasperReports? JasperReports – An Example Recommended tools for JasperReports
What is OpenReports?
OpenReports usage Practice
What is OpenReports?
It is a web based report generation and administration interface. It supports a variety of open source reporting engines, including JasperReports, JFreeReport, JXLS, and Eclipse BIRT. It is a front end for JasperReports: OpenReports generates reports using JasperReports libraries.
What is OpenReports?
Feature includes:
Supported file types: PDF, HTML, CSV, XLS, RTF, and Image. Web based Administration of Users, Groups, Reports, Parameters, and DataSources. We can assign which users can access which groups, and which reports are in which groups. Flexible Scheduling to generate reports. Comprehensive Report Parameter support, including Date, Text, List, Query, and Boolean parameters.
Outline
What is JasperReports? JasperReports – An Example Recommended tools for JasperReports What is OpenReports?
OpenReports usage
Practice
OpenReports usage
To add a new user: add a new record in report_user table. Login screen:
OpenReports usage (cont.)
To add a new report file: Go to Administration->Reports->”Upload Report Files” Select a .jrxml or .jasper file.
OpenReports usage (cont.)
To add a new data source: Go to Administration-> DataSources> Add DataSource.
OpenReports usage (cont.)
To add a new parameter: Go to Administration-> Parameters -> “Add Report Parameter”.
OpenReports usage (cont.)
To add a new report:
Go to Administration->Reports->Add Report.
OpenReports usage (cont.)
To add a new group which use a report: Go to Administration->Groups->”Add Report Group”
OpenReports usage (cont.)
To add a new User who belongs to a group: Go to Administration->Users->”Add User”.
OpenReports usage (cont.)
To generate a report:
Log on with a specified User Name/Password who belong to a group which can view a report. Go to “User Reports”. Select a report. Select “Run” or “Schedule”.
OpenReports usage (cont.)
OpenReports usage (cont.)
The resulting report:
Outline
What is JasperReports? JasperReports – An Example Recommended tools for JasperReports What is OpenReports? OpenReports usage
Practice
Practice
Download JasperReports to $JasperReports. Start database server: Navigate to $JasperReports\demo\hsqldb Call ant
Practice
Download iReport to $iReport. Start iReport: run iReport.bat Open demo_report_1.jrxml Edit and run demo_report_1
References
OpenReports homepage: http://oreports.com/ JasperReports homepage: http://jasperforge.org/sf/projects/jasperreports iReports homepage: http://sourceforge.net/projects/ireport/ JasperAssistant homepage: http://www.jasperassistant.com/