Creating Report Using JasperReports
page 1 of 9
Published: 05 Mar 2007
Abstract
JasperReports is report generating tool written in Java. It can produce a report in multiple formats, such as PDF, HTML, XLS, CSV and many others. It also includes features like charts, scriplets, subreports, etc. This tutorial explains how to get started with JasperReports by creating a simple report in PDF and XLS format using a Servlet.
by Anuva Das
Feedback
Average Rating: 
Views (Total / Last 10 Days): 110428/ 90

Introduction

JasperReports is a very popular open source report generating tool, written in pure Java and can be used to deliver dynamic content to the screen or printer. It can create reports in multiple formats, such as HTML file, PDF file, Excel file, CSV file , XML file, etc. It is capable of producing a report using data from a database, parameters, variables expressions and groups, etc. It also includes features, such as chart, crosstab, custom data sources, scriptlet, and subreport. Unfortunately, it is not clearly documented. I had a hard time creating a simple report. This tutorial demonstrates how to get started with JasperReports.


View Entire Article

User Comments

Title: thanx for post the libraries   
Name: User
Date: 2012-11-26 7:45:49 AM
Comment:
thanx for post the libraries it's needed
Title: ******************************************************************************************************************************************************   
Name: ************************************************************************************************************************
Date: 2012-11-21 5:58:07 AM
Comment:
**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
Title: Report   
Name: Tapas
Date: 2012-11-07 9:01:13 AM
Comment:
Comment
Title: gh   
Name: fhgfh
Date: 2012-11-07 8:59:36 AM
Comment:
gfhgfhgfh
Title: PDF   
Name: PDF TESTING
Date: 2012-11-06 4:33:14 AM
Comment:
EXAMPLE FOR PDF TEST
Title: hjhjh   
Name: mnmnm
Date: 2012-11-01 3:51:50 PM
Comment:
mnmnmnmnmnm
Title: aa   
Name: aaaaa
Date: 2012-09-28 3:33:35 AM
Comment:
eee
Title: aaaa   
Name: aaa
Date: 2012-08-15 8:21:12 PM
Comment:
aaaaa
Title: test   
Name: test
Date: 2012-06-13 6:11:47 AM
Comment:
test
Title: jasper report   
Name: Ektaa Mehta
Date: 2012-06-11 5:46:38 AM
Comment:
really helpful for newbees like me to start of..good work..thanks..
Title: Jasper Report   
Name: Debasish Parthasarathi
Date: 2012-05-09 12:49:54 AM
Comment:
Hello Anuva
you are great, I appreciate you work , you explained so well that anyone can understand
keep it up
Hats off to you!!!
Thanks


Regards
Parth,09742140722
Title: Jasper Report   
Name: Meharaj Fareedy
Date: 2012-04-26 7:44:09 AM
Comment:
Hi friends.. It is a very good article .very good explanation.I generate report only first atempt.
very nice post.
Title: Jasper Report   
Name: meharaj
Date: 2012-04-26 7:42:10 AM
Comment:
nice article. now i am able to ganerate report using java.
Title: Jasper Report (how we run in eclipse (procedure))   
Name: Omprakash saran
Date: 2012-04-10 6:24:57 AM
Comment:
HI friends i want to use jasper report in eclipse IDE ..
so please tell me how i run the jasper report to generate the pdf file........
please tell the flow of the programs.....please help me>>
.
.REQUEST>
.
..
.Thnx&Regards
Omprakash saran
Title: Calling servlet from browsre   
Name: Carl Hubscher
Date: 2012-01-09 6:11:55 PM
Comment:
Great article, have compile example in Eclipse and take my class and plasd in WEB_INF/classes folder for JasperServer in Tomcat, how do I call it from browser??? I added servlet entry to its Web.xml file, maybe my servlet-class entry not correct. Keep getting resource not found. Much appreciate any help. Email: carlhub@aol.com
Title: MR.   
Name: SHAKIR HUSSAIN
Date: 2011-11-22 9:23:37 AM
Comment:
GOOD :)
Title: Mr.   
Name: Anand Mahajan, Khargone [MP]
Date: 2011-09-07 4:16:13 AM
Comment:
i like & use JasperReport
Title: about jasper report integration in a php system   
Name: jimbo
Date: 2011-08-18 9:20:55 PM
Comment:
we're currently creating a management system with php
and we found jasper report as a report generating tool .

may i ask what would be the output when you integrate the jasperreport in your php system ?

and what will we need to do it ,

thanks .
Title: how to use this in linux   
Name: loganahtan
Date: 2011-04-07 11:06:49 AM
Comment:
if anyone help me .........plz..thanks in advace.......
Title: how to use jasper report with c#   
Name: Satnam Singh
Date: 2011-02-07 10:41:51 AM
Comment:
how to use jasper report with c sharp with database mysql
Title: Jasper Report   
Name: rahulkushwaha418@gmail.com
Date: 2011-02-03 4:06:52 AM
Comment:
great work..!!!!!
after a long searching ..i got the best tutorial for the Jasper report...
thanx !!
Title: gallery hotel   
Name: pea.king@yahoo.com
Date: 2011-01-14 3:53:59 PM
Comment:
hi good morning am john how are you doing i will like chat with you online
because you look so good here is my is id plantainboy_john@yahoo.co.uk
Title: About JasperReport   
Name: GopalaKrishna
Date: 2010-09-03 12:09:22 AM
Comment:
I know how o call jasper report from JSP.
But in my project once i had given the data and execute the report, but in same form i had been change the data and executed again but it wont work for second time.
I want to know the reason why it is not executed second time.
Title: jasper   
Name: ganesh
Date: 2010-08-30 8:00:39 AM
Comment:
very good article proved best for reporting tools
Title: JasperReports 3.6 Development Cookbook by Packt Publishing   
Name: trafique
Date: 2010-07-20 4:31:30 AM
Comment:
Packt Publishing has just published a new book on JasperReports titled "JasperReports 3.6 Development Cookbook" by "Bilal Siddiqui".
Title: NICE work   
Name: Indrajeet Singh
Date: 2010-06-28 6:32:04 AM
Comment:
hey thanks for your contribution..
CarryON where do i get some more sample codes and explanations as i am a beginner and not an adept developer
Title: Reports   
Name: Anthony
Date: 2010-06-24 7:19:45 PM
Comment:
Hey...Great tutorial there....thanx 4 your great contribution....
Title: DynamicReports   
Name: Ricardo
Date: 2010-05-31 2:33:44 PM
Comment:
DynamicReports, an open source library based on JasperReports.
The main benefit of this library is a dynamic report design and no need for a visual report designer.
http://dynamicreports.sourceforge.net
Title: About jars   
Name: venkat
Date: 2010-05-22 6:31:54 AM
Comment:
Where do i get the above jar files
Title: how to Jasper report Print in client machine   
Name: Masuk
Date: 2010-05-14 7:12:46 AM
Comment:
how to print report in client machine.
my e_mail Id :- masuksk@yahoo.com
Title: how to view Jasper report in client machine   
Name: Masuk
Date: 2010-05-14 6:15:05 AM
Comment:
how to view Jasper report in client machine from server machine. And print client machine.
Title: jrxml to pdf   
Name: Amol
Date: 2010-03-31 7:28:42 AM
Comment:
Hi i would like to know how can i convert a .jrxml file to a pdf without using .class file i have created .jrxml from ireport

pls help me i have been searching for this things from last two days

my emailid is:amolimore@gmail.com
Title: freeze pane   
Name: Vision
Date: 2010-03-23 8:51:51 AM
Comment:
Hi,
How do we achieve freeze pane option in Jasper?
Can it be done thru ireport 3.5.1 ?

Pls help
Title: unknown.parameter.type.for.multiple.value.input   
Name: shv
Date: 2010-03-15 5:15:37 AM
Comment:
hi,

i am getting this erros"unknown.parameter.type.for.multiple.value.input" at the time of choosing multiple objects after i created multi-select query at input-control.

how we can resolv,pls let me know..

regards
Title: Multiple Queries in jrxml file   
Name: Daemolala
Date: 2010-02-23 12:15:34 PM
Comment:
Is it possible to have two multiple queries in one jrxml file? Thanks.
Title: Nice atricle   
Name: AngloPolish
Date: 2010-01-25 8:12:23 AM
Comment:
Nice article, but what about spring integration?
Title: error while using jasper reports api in java   
Name: Saibhargav146
Date: 2010-01-08 10:24:42 AM
Comment:
i have a problem with jasper reports

iam creating a dynamic xml for report and converting it into a xml string but while loading the same string in JasperCompileManager.CompileReport()..
iam getting a error

filenotfoundException...
from that xml string
plzzzz anyone answer me.........


Thank u in advance
Saibhargav146
Title: jsper reports   
Name: Reproting tools
Date: 2010-01-02 11:15:36 PM
Comment:
very good article proved best for reporting tools
chakradhar
check.c.c@gmail.com
Title: POI version   
Name: Carl Mosca
Date: 2009-11-16 2:47:28 PM
Comment:
Very nice article. The one thing I would add is the (compatible) version of Apache POI. I found that as of the current release of JasperReports (3.6.1), version 3.2 FINAL of POI works but the current release of POI (3.5 FINAL) would not work. I imagine this is a moving target but it's worth noting.
Title: THIS SITE IS POORLY DESIGNED   
Name: jegreat
Date: 2009-09-23 8:47:20 AM
Comment:
wel i biliv i hv seen so many blogs but this one is xtremely poorly designed coz we can just see questions and NO WHERE to reply or at least we cant even see solutions to solved ones. then wats the use?
Title: Problem with iReport in Netbeans   
Name: Sumit kumar Pal(Sam)
Date: 2009-08-22 9:01:56 AM
Comment:
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.sql.SQLException: The statement is closed.
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

root cause

java.lang.RuntimeException: java.sql.SQLException: The statement is closed.
hms.utility.db.DBConnection$1.closeAll(DBConnection.java:98)
hms.utility.db.DBConnection$1.getRowSet(DBConnection.java:412)
Attendance.AttendanceReport.setPopNameById(AttendanceReport.java:140)
Attendance.AttendanceReportAction.execute(AttendanceReportAction.java:60)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.
Apache Tomcat/5.5.20
Title: RE: Jasper Reports CSV Output HELP   
Name: Rajesh R
Date: 2009-08-19 7:16:32 AM
Comment:
My email id = erajesh1986@rediffmail.com

Kindly someone reply. As it is reaaly important for em to sort this issue out.
Title: Jasper Reports CSV Output HELP   
Name: Rajesh R
Date: 2009-08-18 8:55:14 AM
Comment:
Hi,
Hope you can solve a doubt I’m having in Jasper Reports CSV Output.

The CSV Output that gets generated for me is : Field1,Field2,Field3,Field4,Field5

While I desire the output: "Field1","Field2","Field3","Field4","Field5"

The Java code I’m using for this purpose is pasted below.

JasperDesign design = JRXmlLoader.load(jasperReportFileNameAndLocation);
log.debug("JasperDesign object successfully created");

JasperReport report = JasperCompileManager.compileReport(design);
log.debug("JasperReport object successfully created");

JasperPrint print = JasperFillManager.fillReport(report, params, conn);
log.debug("JasperPrint object successfully created");

OutputStream ouputStream= new FileOutputStream(new File(outputFileNameAndLocation));
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
JRCsvExporter exporterCSV = new JRCsvExporter();
exporterCSV.setParameter(JRXlsExporterParameter.JASPER_PRINT, print);
exporterCSV.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, byteArrayOutputStream);
exporterCSV.exportReport();
ouputStream.write(byteArrayOutputStream.toByteArray());
ouputStream.flush();
ouputStream.close();
log.debug("CSV Report successfully generated & saved at - " + outputFileNameAndLocation);
Title: Creating Report using jasper repot   
Name: Sunita
Date: 2009-08-18 3:43:34 AM
Comment:
It's a very good article for beginners in jasper report. For siingle query it is working fine.

thanks
Title: Working with multiple Reports   
Name: Srinivas
Date: 2009-08-05 1:01:22 AM
Comment:
It's a good article.For executing single query we are creating .jrxml file,then we are executing the jsp/Servlet by using the jdbc connections,finally generating the report.But i want to execute multiple queries with the same .jrxml file and generate reports based on the how many queries.

This is my mailid:seenuindia555@rediffmail.com or seenuindia555@gamil.com

Thanks & Regards,
Srinivas,
Bangalore,
+91-9945081041.
Title: Working With Sub Reports   
Name: Sundararajan
Date: 2009-07-26 3:09:45 AM
Comment:
This example work successfully for single report. If i am using sub report the report can not be loaded. How to solve the problem.
Title: Creating Report Using JasperReports   
Name: Amin Bardai
Date: 2009-07-16 4:46:47 PM
Comment:
I am advised by developers that when I export data into XLS, all data will export onto a single workSHEET. Thus, if I export more records then JR will take the first 64,000 (or so as per the Excel limitation) and ignore the rest. This makes the XLS export rather useless.

Cannot JR take the data and load it onto as many workSHEETS as necessary in a single workBOOK? I am unable to learn if or not this can be done from the article
Title: JasperReport in servlet   
Name: Gbenga
Date: 2009-07-10 9:09:15 AM
Comment:
i tried but it is still giving error
Title: More than one Query String   
Name: Denison
Date: 2009-05-01 11:28:20 PM
Comment:
Hi All,

is it Possible to use more than one Query String in the same Report (JRXML) ?
Title: Good Article   
Name: Bhuvaneswari P.L
Date: 2009-04-22 1:55:25 PM
Comment:
Excellent Article. I had been trying to implement jasper reports within java for quite a long time. This article really helped me a lot. This is a good article for beginners.
Title: jasper reports   
Name: Bhavani
Date: 2009-04-22 1:43:35 AM
Comment:
Really good tutorial.it helped me a lot.
Title: japser reports   
Name: tanvi
Date: 2009-04-07 8:24:56 AM
Comment:
Hi,
i'm a newbie to jasper reports. We are generating charts using jasper reports. However, i see that the charts are displayed in the pdf and xls format but are not visible using html format.
Please let me know if any one has some suggestions over this issue.

Thanks :)
Title: Exporting JasperReports in Excel, Word and PowerPoint formats   
Name: Usman
Date: 2009-04-06 4:10:58 PM
Comment:
Aspose enables JasperReports developers to export their reports in PowerPoint (PPT, PPS formats) and Word document (DOC, DOCX, HTML and TXT formats). Another export format Excel (XLS) is about to be supported in near future. http://www.aspose.com/categories/jasperreports-exporters/default.aspx
Title: problem in subreport using jasper report   
Name: Hari
Date: 2009-03-25 8:09:44 AM
Comment:
how to create sub report and how to pass the sub report to main report using jasper report and java
Title: Help me to implement multiple value as a parameter   
Name: Dipankar
Date: 2009-03-24 3:14:06 AM
Comment:
How should I define (what java class to use) a parameter that is multi-select-from-query Input control? I tried java.util.List, but got "jsexception.unknown.parameter.type.for.multiple.value.input" . The control itself populates all right. Would you recommend some materials describing the topic? Thanks.
Title: Please anyone help me   
Name: Dipankar
Date: 2009-03-24 3:06:03 AM
Comment:
I have made a report(SP) through iReport3.1.4.I have uploaded it to jasper server 3.5.I have created a multiple parameter field.whenever i am giving the input in jrxml file the multiple parameter value.then an error is coming that "Unknown parameter type java.lang.String for multiple value input". How can i solve it.
Title: jasper with C#   
Name: kiran
Date: 2009-03-16 10:57:48 PM
Comment:
Is it possible to generate the Jasper Reports with C#.
please let me know the steps or information regarding this.
Title: Reply to Shreelatha   
Name: Nagraj
Date: 2009-03-16 10:42:46 PM
Comment:
yes, we can develop jasper reports without a plugin , but u need to have few lib files in your path.
Title: jasper report   
Name: shreelatha
Date: 2009-03-05 7:09:39 AM
Comment:
is it possible to develop jasper report without a plugin in eclipse or netbeans(by only using jarfiles)
Title: JBOSS   
Name: Sridhar
Date: 2009-02-16 2:10:21 AM
Comment:
I am new to Jasper reports. How can i install jasper reports against JBOSS in Linux.
Thanks in advance.
Title: Hibernate   
Name: Guru
Date: 2009-02-13 12:49:52 AM
Comment:
Hi,
I am developed hibernate application i got one exception like this
" log4j:WARN No appenders could be found for logger (TestClient).
log4j:WARN Please initialize the log4j system properly.
%%%% Error Creating SessionFactory %%%%
org.hibernate.HibernateException: /hibernate.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1411)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1433)
at de.laliluna.example.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:40)
at de.laliluna.example.TestClient.createHoney(TestClient.java:30)
at de.laliluna.example.TestClient.main(TestClient.java:16)
Exception in thread "main" java.lang.NullPointerException
at de.laliluna.example.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:48)
at de.laliluna.example.TestClient.createHoney(TestClient.java:30)
at de.laliluna.example.TestClient.main(TestClient.java:16)"
anybody can tell me the solution for this exception...
Title: Printing Records Horizontally   
Name: Anil
Date: 2009-02-09 1:34:20 AM
Comment:
Hi,

I am using ireport 1.2.5 for designing Jasper reports.

I got one problem...

The requirement for my report is like this..

Generally, we will display the records which we get from database in a vertical order. But now , I have to display this in horizontal order.


For example, query is

select date from dual;

For this query the general result would be as below:


Date:(Static Text)

01/01/2000
01/02/2001
01/04/2008
01/01/2010

But,I dont want like that.

I have to show output as below.....


Date: 01/01/2000 01/02/2001 01/04/2008 01/01/2010


I think you understood my doubt..

Please give me the solution for this...

Send me the replies to my mail id:
anilkumar.bikki@3i-infotech.com
Title: Swing application   
Name: reddy dasari
Date: 2009-02-03 11:19:41 AM
Comment:
hi ,

please help... how to create a jasper reports (ireport) using swing application
Title: jasper report   
Name: Bala manickam
Date: 2009-01-21 12:53:28 AM
Comment:
Hi,
I generated jasper report by using jasper tool but i dont know how convert this reprt into pdf & html format any body known how to convert pdfor html format means please tell me to www.balachandar@gmail.com
Title: swing applications   
Name: pankaj
Date: 2009-01-15 12:50:14 AM
Comment:
i have created report using ireport.i want to use it in swing applications.i m using netbeans 6.5 i want to print report using jasperrunner button.can anybody plz tell me the code. u can send code 2 pankajkaushal@aol.in.plz send
Title: Swings Application   
Name: kumar
Date: 2009-01-13 12:41:03 AM
Comment:
hi i'm using Jasper Report in swing application, i'm calling my viewer page in my JPanel,

When i'm calling viewer page as

JPanel.add(jasperpage,BorderLayout.Center);
this.getContentPane().add(JPanel);
pack();
Show();


It's not showing any Exception, my output also not displaying in my JPanel.


If possible please send me your response in my mailID
sagmurait07@gmail.com
please send me sample code to reffer how to use jasper report in Swings application.
Title: Swings Application   
Name: kumar
Date: 2009-01-13 12:37:34 AM
Comment:
hi i'm using Jasper Report in swing application, i'm calling my viewer page in my JPanel,

When i'm calling viewer page as

JPanel.add(jasperpage,BorderLayout.Center);
this.getContentPane().add(JPanel);
pack();
Show();


It's not showing any Exception, my output also not displaying in my JPanel.
Title: QUERY STRING   
Name: nathan
Date: 2009-01-01 11:29:36 PM
Comment:
hai can't two query string using one jrxml file if do you need subreport using can be used.
Further Details : kolanchinathan.e@gmail.com

thanks & regarding
kolanchinathan.R
Title: retrieve the variable into the report   
Name: sathya
Date: 2008-12-27 6:25:34 AM
Comment:
i need a help to add the variable value into the ireport?
any one help me
reply me to subarajan_85@yahoo.co.in
Title: add chart into report   
Name: mummoorthi
Date: 2008-12-24 1:09:11 AM
Comment:
i new to ireport. i want to take report for such record for ms access database with chart. anyone can guide me please
Title: xplain more detail on point 4   
Name: anaRodhi
Date: 2008-11-03 8:32:49 PM
Comment:
plz xplain more details on point 4..
Title: how to run a Jasper report   
Name: eddiegeerts@hotmail.com
Date: 2008-11-01 9:53:06 AM
Comment:
Hi, I would like to run a jasper report (.jrxml/.jasper file) by asp.net/vb.net, eg. I want to run the jasperreport and the output (html/pdf) must be stored in a directory.
Can anyone me provide some examples of how to do this ??
Title: image symbols in jasper html report   
Name: v.naresh8@gmail.com
Date: 2008-10-11 6:58:54 AM
Comment:
i developed a html report using jasper successfully..but, in that html source code automatically
"img alt="" src="nullpx"

please send the solution to my mail
Title: Using two query strings in jrxml   
Name: Lavanya
Date: 2008-09-24 1:50:38 AM
Comment:
Can we use two query strings in jrxml?
Title: i can't make a jasper report can any body help me????   
Name: chokz_1009@yahoo.com
Date: 2008-09-07 11:46:10 PM
Comment:
can any one help me how to make a jasper report using java....

thx... f ever xend on my account plz.... chokz_1009@yahoo.com
Title: annot make pages of report   
Name: Paresh
Date: 2008-09-02 12:41:46 AM
Comment:
I am making an inventory software. I pick up data for reports from database. Can anyone please tell me how to present it in pages and also how to add code to print. Please reply at parfive_05@yahoo.co.in
Title: Cannot Load .jrxml from my project   
Name: kathu
Date: 2008-06-12 3:51:16 AM
Comment:
When i JasperReport jasperReport = JasperCompileManager
.compileReport(jasperDesign);& load my .jrxml in my application it throws io.file not found exception plz help
Title: Jasper with ASP.NET   
Name: Prince
Date: 2008-05-20 8:44:13 AM
Comment:
Hi..
I have created a DEMO.jrxml file using ireports.. now i need to integrate it with my asp.net application.. could anyone suggest a gud url for doing this?

how can i deploy it? and how do i pass the parameter values as querystring inputs for the same?
Title: Jasper with Asp.net   
Name: Jack
Date: 2008-03-18 4:24:25 AM
Comment:
How can I use JasperReports along with Asp.net?
Title: two query in one jrxml file   
Name: Hum
Date: 2008-03-17 8:59:49 AM
Comment:
Is it possible to have two multiple queries in one jrxml file? THanks.
Title: Generating Report in PDF or XLS format in Swing application(JAVA)   
Name: uday
Date: 2008-03-03 5:05:56 AM
Comment:
hi,

i am retrieving the data(reports) to embedded database but i need to how to database selected table data export to xls format. plz help me swings code. i'm using netbeans ide.please reply me on udaymyadam@gmail.com
Title: Reportunit   
Name: Aadam
Date: 2008-02-19 4:34:43 AM
Comment:
HI
i have created the reports and tried to connect the report using the reportunit concept,when i executed the report the second report which is linked through the frist report show all the data without taking the the condition.

ex:i have clicked on the perticular field say emp name(xyz) the second report should show the result of that [xyz] employee.
Could any one help on this

regds
Aadam
Title: jasper Rpeort   
Name: Nilesh
Date: 2008-01-25 6:59:31 AM
Comment:
Hi can u any one tell me how to create dynamic header in jasper Report and can we execute two query in one jrxml file
Title: Error in executing jasper report   
Name: Gandhi
Date: 2007-11-27 12:24:09 AM
Comment:
hi,
i have created japser report and it works fine in local server. but i encounter problem while executing in server linux .. please help me out to solve this . i have included all the necessary jar files too... i am getting the following error


net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
public class EnquiryListReport_1196137097748_696339 extends JREvaluator
<--------->
1 errors

at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:193)
at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:212)
at com.amslogic.reports.EnquiryList.doGet(EnquiryList.java:50)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:272)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245)
at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:177)
at org.apa
Title: Generating Report in PDF or XLS format in Dot NET enviroment   
Name: Zaraq
Date: 2007-11-16 5:57:59 AM
Comment:
could u please help me by updating me the info. i m working on Anti Norcotics force Database where they do keep the records of suspects n criminal. i wanted to know that how could we genenrate reports in PDF or XLS format. please reply me on zarak18@hotmail.com thanks
Title: Jasper in Swing reply   
Name: kruger
Date: 2007-10-20 5:54:28 AM
Comment:
yes jasper can be used in swing application
Title: Jasper in Swing   
Name: yanti
Date: 2007-10-04 2:54:48 AM
Comment:
Hai,,hai,,,Friends please help me,
can Jasper in use in Swing Application??
thanks be4..
Title: jasperreports in struts2   
Name: pratap
Date: 2007-09-26 12:46:01 PM
Comment:
how to generate jasperreports using struts2 in order to retrieve data from database
Title: WEBFOCUS   
Name: Valerie Young
Date: 2007-09-06 9:22:34 AM
Comment:
In the webfocus training we touched basics on standard reports, crating reports, sharing reports and olap reports.
Title: Well Article   
Name: Rajesh Das
Date: 2007-08-24 4:41:08 AM
Comment:
I need Sample code for this report using through Applet.
Title: One more Query..   
Name: Kranthi Kiran
Date: 2007-08-23 12:07:48 PM
Comment:
Anuva,

where are we specifying connection attributes in jrxml file.. is it not required? How does it compile?

Regards,
Kranthi
Title: Well articulated article..   
Name: Kranthi Kiran
Date: 2007-08-23 11:46:27 AM
Comment:
Hi Anuva,

Thanks for the wonderful, simple article. My questions are--
1#Is JDBC conn. mandatory..? we are using Hibernate and through DAO I get List of objects,I want to iterate the list and print. How can I do this?

2#Do we have to compile jrxml every time we run?

3# I just tried with Jasper Assistant and I genereted pdf and how can I use that jasper file in my servlet?

Regards,
Kranthi
Title: Error   
Name: Prabha
Date: 2007-07-11 12:40:36 AM
Comment:
Iam trying to copy that xml file nad pasting here but iam geeting the following error

We apologize for the inconvenience. This error has been logged and our support staff has been notified.
Thanks, AspAlliance Staff
Title: reply to Prabha   
Name: anuva
Date: 2007-07-10 1:33:27 AM
Comment:
Send me ur XML data source.So that i can test it.
Title: Error   
Name: Prabha
Date: 2007-07-10 12:14:15 AM
Comment:
I used the database connection and tried your code.I have a table with two columns 'name' and 'age'.But ian getting the same error.
java.lang.NoSuchMethodError: org.jfree.chart.ChartFactory.createPieChart(Ljava/lang/String;Lorg/jfree/data/general/PieDataset;ZZZ)Lorg/jfree/chart/JFreeChart;
at net.sf.jasperreports.engine.fill.JRFillChart.evaluatePieImage(JRFillChart.java:1525)
at net.sf.jasperreports.engine.fill.JRFillChart.evaluateImage(JRFillChart.java:712)
at net.sf.jasperreports.engine.fill.JRFillChart.evaluate(JRFillChart.java:669)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:277)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:399)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummaryNewPage(JRVerticalFiller.java:1031)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummary(JRVerticalFiller.java:772)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportEnd(JRVerticalFiller.java:259)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:135)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:758)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:666)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402)
at Servlet_graph.main(Servlet_graph.java:28)
Exception in thread "main"
Title: Error   
Name: Prabha
Date: 2007-07-08 10:56:42 PM
Comment:
Iam trying to send the xml file but some error is displaying.I couldnt send it.
Title: To Prabha   
Name: Anuva
Date: 2007-07-06 1:33:16 AM
Comment:
Could u plz send me ur XML data source?? So that i can test it.
Title: Error   
Name: Prabha
Date: 2007-07-06 1:10:15 AM
Comment:
No. Actaully i have included jFreechart.Other programs related to jfreechart works fine.
Title: reply to prabh   
Name: Anuva
Date: 2007-07-05 7:49:07 AM
Comment:
i think u have not included the JfreeChart jar file on ur classpath.First set the classpath for it.
Title: Error   
Name: Prabha
Date: 2007-07-05 3:36:06 AM
Comment:
Thanks again.i tried your code.But iam getting the following error:
java.lang.NoSuchMethodError: org.jfree.chart.ChartFactory.createPieChart(Ljava/lang/String;Lorg/jfree/data/general/PieDataset;ZZZ)Lorg/jfree/chart/JFreeChart;
at net.sf.jasperreports.engine.fill.JRFillChart.evaluatePieImage(JRFillChart.java:1525)
at net.sf.jasperreports.engine.fill.JRFillChart.evaluateImage(JRFillChart.java:712)
at net.sf.jasperreports.engine.fill.JRFillChart.evaluate(JRFillChart.java:669)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:277)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:399)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummarySamePage(JRVerticalFiller.java:834)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummary(JRVerticalFiller.java:768)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportEnd(JRVerticalFiller.java:259)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:135)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:758)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:685)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601)
at chart4.main(chart4.java:40)
Exception in thread "main"
Title: Reply to Prabha   
Name: Anuva
Date: 2007-07-05 2:07:03 AM
Comment:
This is the java code for creating chart.

import java.io.*;
import java.util.HashMap;
import java.util.Map;
import java.sql.*;
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.engine.xml.JRXmlLoader;
import net.sf.jasperreports.view.JasperViewer;
import net.sf.jasperreports.view.JasperDesignViewer;

public class chart{
public static void main(String[] args){
Connection jdbcConnection = null;
JasperReport jasperReport;
JasperPrint jasperPrint;
JasperDesign jasperDesign;
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
jdbcConnection = DriverManager.getConnection("jdbc:oracle:thin:@192.168.10.85:1521:oracledb",
"xxx","yyy");
jasperDesign = JRXmlLoader.load ("C:/ireportforarticle/pieChart.jrxml");
jasperReport = JasperCompileManager.compileReport(jasperDesign);
jasperPrint = JasperFillManager.fillReport(jasperReport,null,jdbcConnection);
JasperExportManager.exportReportToPdfFile(jasperPrint,"C:/iReportExample/chart/pieChart.pdf");
//for creating report in html format
JasperExportManager.exportReportToHtmlFile(jasperPrint,"C:/iReportExample/chart/piechart.html");
//To view report using JasperViewer
JasperViewer.viewReport(jasperPrint);
}catch (SQLException ex){ex.printStackTrace();
}catch (ClassNotFoundException ex){ex.printStackTrace();
}catch (JRException e){e.printStackTrace();
}}}

U have to include JCommon jar and JFreeChart jar files on ur class path.
Hope this will help u.
Title: reports for graph(thanks anuva)   
Name: prabha
Date: 2007-07-03 4:52:28 AM
Comment:
thanks for your reply.But iam not using servlets in my code.I have to write a java code and using xml datasource.Do you have samples for it?Should i have to import JFreechart for creating charts?Kindly help.
Title: reply to Prabha   
Name: Anuva
Date: 2007-06-29 6:36:23 AM
Comment:
First design a JRXML file that contain ur Chart, then use the following servlet code to create a report in pdf/html.

import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
import java.sql.*;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.engine.xml.JRXmlLoader;
import net.sf.jasperreports.engine.export.*;

public class chart extends HttpServlet{
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException{
ServletOutputStream servletOutputStream = response.getOutputStream();
Connection conn = null;
JasperReport jasperReport;
JasperPrint jasperPrint;
JasperDesign jasperDesign;
try{
// get a database connection
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection
("jdbc:oracle:thin:@192.168.10.85:1521:oracledb",
"xxx","yyy");
// load JasperDesign and compile it into JasperReport
jasperDesign = JRXmlLoader.load("C:/pieChart.jrxml");
jasperReport = JasperCompileManager.compileReport(jasperDesign);
// fill JasperPrint using fillReport() method
jasperPrint = JasperFillManager.fillReport(jasperReport,null,conn);
JasperExportManager.exportReportToPdfFile(jasperPrint,"C:/piechart.pdf");
response.setContentType("application/pdf");
//for creating report in html format
JasperExportManager.exportReportToHtmlFile(jasperPrint,"C:/piechart.html");
JasperExportManager.exportReportToPdfStream
(jasperPrint, servletOutputStream);
servletOutputStream.flush();
servletOutputStream.close();
}
catch(SQLException sqle){
System.err.println(sqle.getMessage());}
catch (ClassNotFoundException e){
Title: reports for greaph   
Name: Prabha
Date: 2007-06-29 5:25:31 AM
Comment:
Hi,

It would be useful for me if you provide tha java code for filling the data to a chart/graph and then producing the final report in pdf/html etc.Also mention the classes and packages to be included.
Title: good Work   
Name: Ramesh
Date: 2007-06-26 5:07:41 PM
Comment:
Hi,

This is really a nice piece of work
Title: report   
Name: boikanyo
Date: 2007-05-15 4:22:14 AM
Comment:
i'm very thank full for this article.it made my work easier.
its a good 1 it deserves a wow.

but hey how about a 1 that shows how to disply that charts on a browser using pdf.

that will be everything.
Title: Fine   
Name: jignesh
Date: 2007-04-04 2:52:25 AM
Comment:
Thanks very useful demostration.
Title: Creating Report Using JasperReports   
Name: jignesh
Date: 2007-04-04 2:52:20 AM
Comment:
Thanks very useful demostration.
Title: Overally a great article.   
Name: debayan
Date: 2007-03-19 1:24:36 AM
Comment:
The thing that mosts interests me is Jasper's ability to export reports to such a large no. of file formats which makes it trully an ideal choice for people working in Java platform. However a brief discussion about JasperReport's operating-environment requirement would have made the
article absolutely complete. Anyway great stuff and very detailed coverage on the process of report generation makes the article very useful for J2EE people.
Title: Good job   
Name: Sandeep
Date: 2007-03-15 11:52:45 PM
Comment:
Good job. Keep moving ahead...
Title: Excellent   
Name: Chandrakanta Kar
Date: 2007-03-15 12:26:57 PM
Comment:
It is very useful for the developers work in J2EE platfrom.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-03-28 5:34:54 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search