DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Coding
  3. Java
  4. Java Reporting: JasperReports

Java Reporting: JasperReports

Hossam Sadik user avatar by
Hossam Sadik
·
Jun. 11, 08 · Interview
Like (1)
Save
Tweet
Share
43.99K Views

Join the DZone community and get the full member experience.

Join For Free

One of the purposes of the software industry is to automate routine activities and summarize the data in a decision-supporting format, commonly known as "reports". That’s the reason customers are used to considering software as the wizard stick that will turn their usual mess into charming charts, graphs, and visualized diagrams. On the other hand, reports are considered the developers' usual nightmare; you can obviously notice the look of misery crossing the victim's face on getting assigned to work on the report module.

When it comes to reports, customers like to change their mind rapidly: "Please, can we add new search criteria !!?", "Oh, that result needs a small change to fit with what we've been wanting", "If only we can group the results by the client's country" and "Oh no, those graph colors hurt my eyes". We can summarize the usual troubles in report development into the following points:

  • Core changes: it's usual to modify/add report core logic to reflect business changes or usability enhancements.
  • Results exporting: There is a wide range of formats to export your report to, such as: HTML, text, PDF, MS Excel, RTF, ODT, Comma-separated values, XML or image.
  • Complicated reports sub-reports and cross-tabs reports are good example.
  • Charts reports: visual chart e.g. Graph, Pie, 3D Pie, Bar, XY Line, Scatter, Meter and Time series.

A lot of frameworks, tools, libraries, and 3rd parties applications were introduced to facilitate the reporting process and to remove the overhead of the mentioned points, our topic today is about one of them .. JasperReport. JasperReport is a well-known open source java reporting engine that gained wide popularity in few years. Unlike other tools –e.g. Crystal Reports- it's based on java and doesn't have its own expression syntax.

Let's read what's written in wikipedia about JasperReports features:

  • PDF, HTML, Microsoft Excel, RTF, ODT, CSV and XML files. The engine allows report definitions to include charts, with the rendering provided by the JFreeChart library which supports many chart layouts, such as Pie, Bar, Stacked Bar, Line, Area, Scatter Plot, Bubble, and Time series.
  • Multiple sources can be merged together. The data can be retrieved from defined data sources such as JDBC, CALS Table Models, JavaBeans, EJBQL, XML, Hibernate, and Comma-separated values, and additional data sources can be added to the JasperReports framework by plugging in a custom JRQueryExecuter. An extension is available to use Oracle PL/SQL stored procedures as a data source.
  • Scriptlets may accompany the report definition, which the report definition can invoke at any point to perform additional processing. The scriptlet is built using Java, and has many hooks that can be invoked before or after stages of the report generation, such as Report, Page, Column or Group.
  • Sub-reports.

As a victim developer I've passed through the report development iterations by its whole faces (designing, implementing, changing, changing, changing and more changing), but I was little more lucky to work with Jasper through this long cycle in sub-reports, Crosstabs, Charts and graphs.

The main difficulty I faced while working with JasperReports was the shortage of resources and tutorials, which is a common problem among developers, so I hope to transfer my personal experience with JasperReports in more detailed articles.

Note: this Article was first published in FCI-H Blog, here

References:
http://www.jasperforge.org/jaspersoft/opensource/business_intelligence/jasperreports/index.html
http://en.wikipedia.org/wiki/Jaspersoft
http://www.javaworld.com/javaworld/jw-09-2002/jw-0920-opensourceprofile.html

 

Java (programming language)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • DZone's Article Submission Guidelines
  • How to Submit a Post to DZone
  • HTTP vs Messaging for Microservices Communications
  • Full Lifecycle API Management Is Dead

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: