tags: Java
, JasperReports
, J2EE
posted: Friday, April 8th, 2005
The most recent project I have been working on involved creating a large number of reports for the company’s extranet/intranet. In the past, I have usually done reports using some form of JSP and JDBC. But in this case, there is a large number of reports to be developed, and so I was tasked with researching some of the open source solutions for reporting, in hopes we could find a solution that would allow us to get the reports done faster, and be provided to the user with more functionality, and with less custom code.
In the end we compared Crystal reports with JasperReports, and JasperReports was picked. JasperReports is not only free, but also is proven in the Java world, and has a lot of users. It is customizable, since its Java and open source, and has support for using Collections or Lists of Business Objects, such as those populated via Hibernate.
Once JasperReports was chosen, I tested several GUI’s to help build the reports instead of editing them strictly in their native XML. JasperAssistant was found to be the best of all of them, and integrates seamlessly with Eclipse. If you are an Eclipse fan as I am, then you’ll love using JasperAssistant. It even allows you to preview the report against your database right in Eclipse.
Next, I looked into OpenReports. OpenReports is a front end for JasperReports. It was written in WebWork, and provides a lot of functionality that you would have to write yourself to get the reports running on the web. It comes with basic security (users, passwords, and reporting groups). You can assign which users can access which groups, and which reports are in which groups. You can also add parameters, and then assign them to a report. You create the JasperReport in JasperAssistant (or with any other tool, including a text editor if you want to do the XML by hand), and then compile it (which JasperAssistant does for you). Then when you add a new report to OpenReports, you select which JasperReport file to use, select your datasource, assign your parameters and the report is ready to be used on the web.
OpenReports allows the user to export the report as a PDF, HTML, CSV, XLS, or PNG. This is all done for you without any additional work. As for parameters, there is some good functionality built in. When you add a Date parameter to your report, it automatically brings up a calendar for the user to select the date with. Also, you can add a query parameter which runs an sql that you have specified, and populates a drop down select box with the results. Parameters can be marked as required or optional, can be several different data types, and can be told to come in in any order needed. There are other parameter options as well. It also allows the user to schedule a report and have it emailed to a user.
I have made some improvements to OpenReports, including the Collection/List functionality to use Business Objects which JasperReports supports, but OpenReports currently doesn’t. At some point I’ll pass that code on to the original developers.
In the end, with JasperReports and OpenReports, the only thing you have to worry about is creating the SQL to get the data. After that, it takes little work to provide a nice looking report in multiple formats on a web site.
Comments (275)
Leave a Comment
Pages: « 28 27 26 25 [24] 23 22 21 20 19 18 … 1 » Show All
can anybody suggest how to send data from JSP page to iReport tool
hi…im a undergrad who is currently working on tis openreports. I need to modify some of the functions in order 2 fulfill my requirements but i don hv any idea how 2 modify d codes as it uses tag lib and im nt familiar with tat, even i wanted 2 change a small thing lk header and footer are complicated for me..pls help..
thx in advanced.
wendy
hi..sir,
i am using jasper report.i had created report using ireport2.0.0 . i had provided query like “select * from employee where emp_designation=$P(designation)”
but, when i am not passing any parameter to it ,it shows no pages.
i want that when parameter value is null then,report should be generated for all designation.so how it can be possible????
please help me.
thanks….
after hy
i need to develope an application thats dponds on reports and ihave some problems so ihope if you can help me
at first ican’t do adynamic report i’m usng netbens 6
and ireport2
h’m waiting foryour reply
@Cristian, openreports isn’t my software.
I just used it on a project a few years ago. You can visit the open reports web site here: http://oreports.com/
Hi Brian, i’ m realy thankful with you and your software OpenReports, but i have a problem with the number of parameter per report, i need define 15 parameter in one report, but when i define the parameter number 11, the aplication don’t show me the upload dialog again.
Please assist:
I have many reports all created with iReport. I have embedded the JasperReports API into my appliation and am using fillReport as so :
JasperPrint jasperPrint = JasperFillManager.fillReport(”file.jasper”, params, conn);
this is throwing a number format exception :
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at net.sf.jasperreports.engine.util.JRProperties.asInteger(JRProperties.java:385)
at net.sf.jasperreports.engine.util.JRProperties.getIntegerProperty(JRProperties.java:363)
at net.sf.jasperreports.engine.util.JRStyleResolver.getFontSize(JRStyleResolver.java:901)
at net.sf.jasperreports.engine.fill.JRFillTextElement.getFontSize(JRFillTextElement.java:1107)
at net.sf.jasperreports.engine.fill.TextMeasurer.(TextMeasurer.java:94)
at net.sf.jasperreports.engine.fill.JRFillTextElement.createTextMeasurer(JRFillTextElement.java:113)
at net.sf.jasperreports.engine.fill.JRFillTextElement.ensureTextMeasurer(JRFillTextElement.java:120)
at net.sf.jasperreports.engine.fill.JRFillTextElement.chopTextElement(JRFillTextElement.java:515)
at net.sf.jasperreports.engine.fill.JRFillStaticText.prepare(JRFillStaticText.java:193)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:343)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:323)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:282)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1382)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:692)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:255)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:113)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:768)
does anyone know why this is so?
Many thanks
Fraser Williams
Hi!,
How can I reference a Parameter into the SQL Query with OpenReports?
For example: SELECT * FROM table WHERE column=”parameter”
How can I reference to the parameter added in OpenReports.
Please, HELP ME !
hi,
please help me deploying openreports as a web application with tomcat. Am getting lifecycle exception.
Pages: « 28 27 26 25 [24] 23 22 21 20 19 18 … 1 » Show All
RSS feed for comments on this post. TrackBack
Hi Brian,
I have read some of your postings, very helpful, I have a question here, hope you can help
I am using OpenReport as my front end to display jasper report, all the reports are done in ireport, it works fine, the Open report is really helpful and works nicely. But now I need to add a search function into the report, and there is no way I can have a input field in the report, so I am thinking to run the report inside the open report, keep the menus on top of the open report page and display the report inside the main frame of the open report, this way, I can simply add a search menu, then any time, user can bring in the search screen and do a search. I know how to make the html report inline, but I don’t know how to keep the header, the menu bar, that contains “Report” “Administration”, etc.
Do you think it is possible to do it? if yes, could you please give me some instruction?
Thank you very much!
Meiren