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 17 … 1 » Show All
for ques 218,
visit http://blog.marcnuri.com/blog/default/
Printing Problem in Client Machines(Printing Permission)
Hello, I came across a problem. I could display my report in applet which I have created with iReport tool. The problem is at the time of printing on the client machine,an error dialog box appears with message “Error In Printing”. I have to configure my java.policy file with some extra code for printing permission. So this has become a problem. If I give this report online how can I configure infinite clients on the web for pritning the report. Is there any other way to do so without configuring the java.policy file in the client machine?
Please Help..
Thanks in Advance
Hi,
we have generated the jasper report, reports are working fine, but there is a small issue in it.
when we are entering the proper data, the data gets populated in the report.
if there is no data means , its should show blank page specified with blank icon the page header.
I am trying for that since last one day, its not working, can u suggest the proper idea to solve the problem.
Thank u,
my mailid : Annaiah_Halappa@infosys.com
i am new to jasper reports using jasper asistant and eclipse 3.2and i want to use dynamic reports…
such as:- select empName from employee_master where city = someValue, and i want to pass value of city at runtime, so how write such a program…plesae provide me with some sample , i have never created ant report in java….
@Jack - Hopefully someone else reading here will be able to help you. Unfortunately, I don’t have any experience with iReport. I haven’t even been doing any JasperReports work now for over a year.
I am a newbie. I just created my first subreport and within the iReport application, it works. I am using the connection expression: $P{REPORT_CONNECTION} and am passing 2 parameters. As I said, within iReports, the appropriate data is retrieved and displayed. But when I execute the report within the web application, no records are retrieved / displayed. I know that the subreport is being found because, to debug, I added a display of the parameters that are being passed and they are displaying accurately. But the detail of the subreport remains blank, which makes me think that the query in the subreport is not being executed. Any clues to a solution would be appreciated. Thanks.
hi.
ill like to know how to use velocity.how do i get started?
i downloaded it but i cant use it.is there a way to install it or u use it like jasper.does it have a graphical designer.
my main aim is to create ad hoc reports.that users select which columns to use at runtime.im using.jsp,servlet,class n tomcat as a server,netbeans, ireports,jasperreports
Hi Brian,
Could you teach me how to embed a report using jasper reports in java into web, i’ve tried to solve this problem several days ago but it didn’t work at all, could you give a simple project, pleaseeeee
Hi Everyone,
I have designed my report using crosstab. it is working fine when i generate from ireport but when i incorporate with my jsp thn the following exception comes…. please help me out as it is very urgent for me and my client.
Thanking You
java.lang.NoClassDefFoundError
net.sf.jasperreports.engine.fill.JRDefaultIncrementerFactory.getFactory(JRDefaultIncrementerFactory.java:108)
net.sf.jasperreports.crosstabs.fill.JRFillCrosstabMeasure.createIncrementerFactory(JRFillCrosstabMeasure.java:133)
net.sf.jasperreports.crosstabs.fill.JRFillCrosstabMeasure.(JRFillCrosstabMeasure.java:59)
net.sf.jasperreports.engine.fill.JRFillObjectFactory.getCrosstabMeasure(JRFillObjectFactory.java:1173)
net.sf.jasperreports.engine.fill.JRFillCrosstab.copyMeasures(JRFillCrosstab.java:199)
net.sf.jasperreports.engine.fill.JRFillCrosstab.(JRFillCrosstab.java:153)
net.sf.jasperreports.engine.fill.JRFillObjectFactory.getCrosstab(JRFillObjectFactory.java:997)
net.sf.jasperreports.crosstabs.base.JRBaseCrosstab.getCopy(JRBaseCrosstab.java:218)
net.sf.jasperreports.engine.fill.JRFillElementGroup.(JRFillElementGroup.java:88)
net.sf.jasperreports.engine.fill.JRFillElementContainer.(JRFillElementContainer.java:88)
net.sf.jasperreports.engine.fill.JRFillBand.(JRFillBand.java:77)
net.sf.jasperreports.engine.fill.JRFillObjectFactory.getBand(JRFillObjectFactory.java:374)
net.sf.jasperreports.engine.fill.JRBaseFiller.(JRBaseFiller.java:407)
net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:92)
net.sf.jasperreports.engine.fill.JRFillSubreport.initSubreportFiller(JRFillSubreport.java:370)
net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:350)
net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:275)
net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:399)
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1289)
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:631)
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:228)
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:128)
net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:750)
net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:647)
net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63)
net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402)
net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:234)
org.apache.jsp.pages.IpMang.IpMangPass_jsp._jspService(IpMangPass_jsp.java:106)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
Pages: « 28 … 27 26 25 24 23 [22] 21 20 19 18 17 … 1 » Show All
RSS feed for comments on this post. TrackBack
Hi im using jasperAssistant..I want to integrate several subreports to 6 pages..what i’ve done is tnat I customized the page height to the sum of a sixpage layout so that I can properly arrange the subreports I wanted on each page..However, when previewing, I was able to view the whole custom page height I’ve made,including those blank spaces since I am using page breaks…any help so that I can view only the printable area and not the whole customized page?