JasperReports is the world’s most popular open source Java reporting library. You can easily embed it into any Java application to deliver sophisticated print or web reporting. You can also use it to create output to files for further processing in applications like Excel. For users with more sophisticated report management requirements, reports designed for JasperReports can be easily migrated to the JasperSoft stand-alone report server, JasperDecisions.
Working Of Jasper Reports
- To generate jasper report we require a JRXML file also called template .
- JRXML file contains the report structure information.
- JRXML file parse by JRXmlLoader and convert it into JasperDesign Object.
- JasperDesign Object contains only design information of the report.
- After compiling JasperDesign Object using JRCompiler it gets converted into Jasper Report without Data .
- Now Data filled into empty JasperReport Object using RS(Result Set) and it will be converted into JasperPrint Object .
- Form JasperPrint Object you have two options
- JasperPrintManager :- From which you can print the report or view the report on the screen
- JasperExportManager : From this you can Export report in HTML, PDF ,XlS format.
Flexible Report Layout
JasperReports enables you to create almost any kind of report imaginable. Reports are built from a numÂber of independently defined and formatted sections: Title, Page Header, Column Header, Group Header, Detail, Group Footer, Column Footer, Page Footer, and Summary. A report can contain any number of nested groups. On each group break, JasperReports inserts a Group Footer and the Group Header for the next group automatically, enabling multiple levels of sub-totals.
Sections can contain layout elements like lines, rectÂangles, images, and static or dynamic text fields, as well as source data and computed data. All report eleÂments can be precisely positioned and sized, allowing for pixel-perfect printed and web-based report layouts Both single- and multiple-column reports are available. Data can be presented in flexible free-form, tabular, crosstab (matrix), or chart formats.
JasperReports easily handles the most complex reÂport requirements through its support for sub reports. Any report can be used as a sub report within another report, and any number of sub-reports can be nested inside a report. Sub-reports can in turn contain other sub-reports down to any level of nesting desired, enÂabling arbitrarily complex report layouts.
Flexible Output Options
JasperReports delivers operational information to wherever you need it: onto the screen, onto the printer, and to other applications. Output formats include PDF, HTML, XLS, CSV, RTF (Word), TXT or XML files. Many JasperSoft customers use Microsoft Excel for further manipulation of the report data. JasperReports proÂvides an embeddable Java Swing viewer for viewing report output and the report design.
“till now we were writing separate code for generating PDF, HTML , XLS but with introduction of Jasper Reports ,by using single JAR file & bunch of codes we can easily generate PDF , HTML, XLS â€.
#1 by shweta - June 2nd, 2008 at 18:39
great,its was quite informative.im quite impress with the jasper and way you explained it.hope jasper help us in our project.
#2 by kavita - June 2nd, 2008 at 18:42
hey nice blog,quite informative…found interesting reading it.keep it up.
#3 by Jayashree - June 2nd, 2008 at 18:47
It’s a knowledgeable blog. This blog is giving useful information about jasper.really liked reading it,so keep writting.
#4 by RJ - June 2nd, 2008 at 18:49
hey buddy it was quite informative,really liked reading ,it was quite interesting..keep writting
#5 by Sherman Wood - June 3rd, 2008 at 01:55
This is a good overview of JasperReports, but I would like to clarify a few things.
JasperDecisions is no longer sold. JasperServer is an open source report server built by the JasperReports project lead, Teodor Danciu, and JasperSoft folks, including myself. JasperServer automates the management of JasperReport templates, connection to data sources, output to different formats, scheduled reporting and security.
If you are interested in JasperReports, also look at iReport, a desktop report designer for JasperReports. iReport allows you to drag and drop report elements to build your report. You can test the report output and deploy the JRXML to JasperServer.
Sherman
JasperSoft
#6 by Sagar - June 9th, 2008 at 11:49
Sorry for the late response buddy… First thing i liked the way you explained this topic here. Its quite simple, clear and elabourative. You won the comment from Sherman who is one of the Jasperfloks. This itself is a huge achivement for your writing. It looks to me as a very powerful tool.
However i have few questions in my mind about JasperReports. It would help us if Sherman can clear them out here.
a. Can i use JapserReports for building a commercial product and sell it alongwith the product?
b. How easy it is to implement the HTML/CSS in PDF reports generated by Jasper Reports? Do the product have any Help documentation available online?
c. How can we contact JasperFolks for the help regarding implementation of JasperReports if required? Does the product have online support for the querries?
We are seriously thinking of using JasperReports for building a product. Any help to clear the doubts is appreciated…
#7 by lina - July 16th, 2008 at 09:17
hi!i would like to ask if it is possible to dynamically create a jasper report using excel files as its database?
#8 by Neelima - August 8th, 2008 at 12:47
Hi All ,
It was very great to see the informative explanation about jasper reports. I have a problem while generating jasper reports .Some times when the result set is empty and we try to generate report in the PDF format, then it is throwing the exception
“No more data to read from socket”. Can any body help me out. And this problem is occuring not frequently.
Thanks
Neelima
#9 by bhuvan - August 9th, 2008 at 13:09
Hi,
I am working with bar-charts and its working fine, but now
I am trying to generate multiple-bar chart, how can i do it using the Dynamic Jasper. If u have any idea/sample code please do forward me.
thanks in advance.
#10 by prasad - September 5th, 2008 at 16:08
Hai right now i am working on dynamic jasper report but i am facing some problem in it i am getting error
“net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : CN
” and
”java.lang.NoSuchMethodException: Property ‘CN’ has no getter method
”
#11 by prasad - September 5th, 2008 at 16:09
plz help me if you some samples plz send me
#12 by vijay - October 9th, 2008 at 20:08
HI I am working on bar chart. But i have problem on grouped bar chart. Means ther are two adjucent bar chart for each category. Please forward the sample code if you have.
Thanks in advance
#13 by santu - April 15th, 2009 at 19:47
how to avoid repeated pie chart , its display pie chart for each bean object
#14 by pradip kashid - April 28th, 2009 at 12:45
Make a group of beans by adding one more attribute to bean . and make group and add that variable to group expression. and relocate your chart into group band as shown below
you can make group of empty string if u don’t want add that variable
don’t put u r graph in detail section
i hope it will work
small example :
#15 by anonymous - March 5th, 2010 at 12:58
can u generate dynamic jasper reports using ireport? the jrxml file generated by the ireport has the static report template. what if i decide the columns in my report based on the fields selected on the screen, will I be able to achieve this through ireport?
also will jasperdecisions scope editor solve this problem?
#16 by pradip - March 5th, 2010 at 20:15
Hi ,
Dynamic column can be added to report using i report. You have to use cross tab it is specially design for dynamically increasing columns.
http://jasperforge.org/website/jasperreportswebsite/trunk/tutorial.html?group_id=102
visit above link it will help you.
Thanks.
#17 by sandeep lokhande - July 23rd, 2010 at 11:50
Hi sir,
I got this blog while searching for grouping for multiple lines in a graph.
Nice well informative blog,
Thank you for such a nice blog.
#18 by poonam mhamane - August 9th, 2010 at 12:17
Thank you for such an elaborative information, but can I get more info. regarding how to add css externally in .jrxml file. And can I customise the look n feel of report respective to format (e.g. HTML or Excel)
#19 by Nuraini - December 31st, 2010 at 23:27
Hi, pls can any one help me out? i am using dynamic jasper report to create my report, i am having problem in putting multiple lines in my title. pls how can i chief that. thx