Creating and Designing Report Using iReport - Part 1
page 1 of 6
Published: 12 Apr 2007
Abstract
iReport is a visual report builder that helps Jasperreport users design and create reports in PDF,XLS,HTML and many other formats. This article demonstrates how to design and create reports and explains several features(such as Parameters, Variables, Groups, Charts, Images etc) of iReport.
by Anuva Das
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 95111/ 1092

Introduction

When creating a report using JasperReports, one of the most painful and error prone tasks is creating JRXML or XML files. Luckily, some alternatives are there. One of the most useful visual report builders is iReport. It help JasperReports users to build reports, generate jasper files and preview reports in PDF, HTML, XLS, and many other formats supported by JasperReports. It also allows users to create more complex reports with charts, images, and subreports, etc.

This article demonstrate how to use iReport to utilize the full power of JasperReports without getting a headache in designing JasperReports using XML template.


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 2 and 5 and type the answer here:

User Comments

Title: Title Problem   
Name: Karthik
Date: 9/29/2009 2:41:19 AM
Comment:
Hi,
I want to print title on second page and hide the page header on second page. If i put title in page header then other page header values also printing. Pls help me. Email:nkarthin@gmail.com
Title: EXAMPLE IN JSP + IREPORT   
Name: rma
Date: 9/17/2009 7:18:03 PM
Comment:
EXAMPLE IN JSP + IREPORT TO pdf

http://www.taringa.net/posts/ebooks-tutoriales/3305461/Reportes-jsp-+-ireport.html
Title: Hyperlink in chart   
Name: Afs
Date: 9/6/2009 12:17:44 PM
Comment:
Hi,
I want to use drill-down functionality in my ireport chart, please help me configure hyperlink. Its really urgent !!!! :(
u can contact me on afsha_star@yahoo.co.in.. Thanks a lot in advance...
Title: Creating Hyperlink in IREPORT   
Name: subramanyam
Date: 8/28/2009 10:33:00 AM
Comment:
Hi prem

thanks you very much for replying. could you please provide your contact number. so that i will explain my problem clearly it is very urgent for me. my contact number is 09848058044
Title: Creating Hyperlink in IREPORT   
Name: Prem
Date: 8/25/2009 5:24:46 AM
Comment:
Hi Subramanyam,
Set the Hyperlink Type as Reference and in the Hyperlink Reference Expression give the URL of another report.
Title: Creating pdf hyperlink suggetion   
Name: Prem
Date: 8/25/2009 5:12:18 AM
Comment:
Hi Subramanyam,
by using event listener we can achieve hyperlink concept in IREPORT.

let me know if any issues, need code send me out.
Title: Hyperlinks in IREPORT   
Name: subramanyam
Date: 8/13/2009 2:37:15 AM
Comment:
Hi AnuvaDas

this is subramanyam. i am using IREPORT to generate reports in my project. i want to create the hyperlinks in the pdf indexpage so that when i am clicking the hyperlink it will take me to the particular title.

could anyone please help me out that how to create the hyperlinks in IREPORT ASAP.

Thanks in advance.
Title: Minnat Siddiqui   
Name: Nazma
Date: 8/7/2009 2:08:59 AM
Comment:
Hi Minnat,

many thanks to u.
Title: how to pass query from java program.   
Name: Amol Kawale
Date: 7/21/2009 12:18:07 AM
Comment:
Hi,
I am using jasper ireport in my project but i unable to pass runtime query to jasper report.Can anyone help me.
amol.skawale@gmail.com
Title: How to call ireport from java program   
Name: Amol Kawale
Date: 7/21/2009 12:16:02 AM
Comment:
Hi,i am using jasper ireport in my project but i unable to call irport from java.Can any help me.
amol.skawale@gmail.com
Title: Line Chart Background Color   
Name: Debobrota Das
Date: 7/9/2009 1:57:08 AM
Comment:
hi. I have a made a nice Line Graph of iReport3.0. In Chart property I have set Background colour as white and as a text . When i run report then chart graph shows Background color nicely but when i save as a PDF then in PDF file shows different color. How to solve?
Title: nazma   
Name: Minnat Siddiqui
Date: 7/8/2009 3:21:25 AM
Comment:
Voto View-> Reports Goups -> New the Add GrpName, add Expression -. Ok
Title: Can u please help me in this   
Name: nazma
Date: 6/18/2009 5:50:59 AM
Comment:
Hi,
Iam using jasper iReport 3.5.0, in this i have create the one report. Now i have to create in this sub groups and totals. how to create? Please help me.

nazmashaik@gmail.com
Title: UserFullInstruction   
Name: SHO
Date: 6/11/2009 2:34:36 AM
Comment:
Really this website is very useful to the developer of iReport.
Title: Editing Old Reports to ireprts   
Name: Alexander Bungas
Date: 4/20/2009 2:34:27 AM
Comment:
How to edit existing report from Openbravo ERP
Title: Crystal report and JSP/netbeans   
Name: Biplob
Date: 3/30/2009 4:36:43 AM
Comment:
I am displaying report using crystal report11 from jsp.Now i want that user should not able to save the report which i am displaying in PDF format.Can i disable the save as button of the pdf report......

Thank u in advance
Title: Installting iReport on ubuntu   
Name: Qamrun Nisa
Date: 3/25/2009 8:25:39 AM
Comment:
Hi,

I wanted to install iReport on ubuntu. I followed the above mentioned steps. But didn't get any file named classes12.jar. I have to use it with Zucker Report in Sugarcrm. How can I do it? Please help me.


Thnx
Title: CAN ANYONE HELP ME   
Name: Dipankar Malik
Date: 3/17/2009 7:32:30 AM
Comment:
Anyone can help me how to create computed column in iReport3.1.4
Title: it's well   
Name: hz
Date: 3/9/2009 4:38:17 AM
Comment:
it's well
Title: ireport   
Name: anks
Date: 2/19/2009 8:35:05 AM
Comment:
Sir,
i want to create bar chart using ireport .
It must show the bar chart showing the status "work done" by the respective employee.
the column from which i m taking this "work done" it also consist "work not done" field.
I want to show bar chart for only "work done" for the respective employee and not "work not done".
Pls help me in solving the problem.
aanksss@gmail.com
Title: varible   
Name: seshu
Date: 2/18/2009 11:36:57 PM
Comment:
hi, i am new to i report..
can we use varibles in place of parameters in rreport Query.....if i do so i am getting an error....
if i use parameter-date for reports----to_date and from_date using <= and >= conditions...
i am still not getting data of to_date....i.e getting data till to_date....
plss help me
thanks..
seshujus4u@gmail.com
Title: crosstab   
Name: Anadna
Date: 1/29/2009 10:56:50 PM
Comment:
Hi, I'm new to jasper reports.I'm trying to create crosstab,i am using ireport3.0.0.someone please help me to create new crosstab.

Thanks.
anandgade21@gmail.com
Title: subreport   
Name: nathan
Date: 12/31/2008 2:27:30 AM
Comment:
hai couldnot load object from location when subreport creation if anyone have know please tellme
kolanchinathan.e@gmail.com
Title: creating hyperlink to report to view another report   
Name: versam
Date: 11/28/2008 5:40:00 AM
Comment:
Hi, I'm new to jasperReports. I have created a report and and want to create a link to that report to view another one and be able to view it in HTML viewer
Title: Bar Chart   
Name: Bill
Date: 10/16/2008 4:30:33 PM
Comment:
Hi I was able to get the pie chart working
But for some reason the bar chart is not working, can someone please help me out.

Thanks,
Title: error in installing ireport Exe   
Name: Prabha
Date: 10/7/2008 4:28:25 AM
Comment:
Getting Error while running iReport saying error while loading configuration file
Title: error in installing ireport Exe   
Name: Prabha
Date: 10/7/2008 4:08:12 AM
Comment:
\
Title: error in installing irport Exe   
Name: Prabha
Date: 10/7/2008 4:07:26 AM
Comment:
\
\
\
\
Title: ireport   
Name: bala
Date: 9/8/2008 7:43:19 AM
Comment:
i am using one main report and one sub report, the main report field value is passed to sub report as parameter, the sub report query is where acctvalue=$p{acctvalue},that the query window will dispayed please set a the default value parameter acct value, please give me the solution
Title: Sum of Variables   
Name: viji
Date: 9/1/2008 1:40:05 AM
Comment:
Hi,
I am using iReport 3.0.0.Now my problem is sum of fieldtype(duration).The data type of field is String.The sum calculation is stored into integer variable(Total number of duration).The error is cannot cast String into int.Please anybody give me the solution.
Title: ireport problem   
Name: emine
Date: 8/19/2008 4:24:25 AM
Comment:
hello..
i am working at ireport 2.0.4 and showing depend to condition(example show or dont show) that my fields come from my database.then when i execute, dont want to see fields's location are blank.how can i solve this problem?
Title: ireport in jsp   
Name: lia
Date: 8/15/2008 2:27:20 AM
Comment:
how to run ireport from jsp..??

kaliana1@yahoo.com
Title: problem with sub-report   
Name: su123
Date: 8/14/2008 9:28:42 AM
Comment:
Hi,
I'm trying to include a sub report within a report. The sub report by itself works perfectly fine. But when i include it in the main report it is not filled with data. I'm using a ORACLE connection. There are no parameters in the sub report. When executed the main report display 'The document has no pages'
Title: how to download and install jasper report 2.0.2 and iReport 2.0.2   
Name: viji
Date: 7/26/2008 1:45:15 AM
Comment:
Please send the required url of downloading jasper 2.0.2 and iReport 2.0.2 and give the steps of installation.
Title: how to call jasperreport from jsp   
Name: meera
Date: 7/2/2008 1:10:05 AM
Comment:
could you please send me a sample code of how to call it from jsp..so it will be very helpful for me...
my email id is testmail_99@yahoo.com
Title: Student SE   
Name: Shirhan
Date: 5/28/2008 9:22:03 AM
Comment:
I am stuck at the parameter thing... by reading this I got the idea. Thank you very much.

Keep up the good work!!

:-)
Title: how to call ireport from jsp   
Name: dhanya
Date: 5/21/2008 5:18:17 PM
Comment:
hi,
i read your article for ireports..and i installed ireport in my system..i made sample reports .but i dont know how to connect it to jsp.in the article its written that a classpath need to be set..how is it?could you please send me a sample code of how to call it from jsp..so t will will be very helpful for me...my id is dhanya.shibu@gmail.com.thanks in advance
Title: help   
Name: Jay
Date: 4/15/2008 5:12:25 AM
Comment:
Hey Im having a problem making an image a background of a field.. I made the field transparent and I sent the image to the back but still the field overshadows the image... How can I make the field transparent so the image can appear behind it..
Title: Hi   
Name: Rajashekharayya
Date: 3/17/2008 3:22:25 AM
Comment:
Hi
Thank You for having discussion of iReport,i am getting a problem during chart export into excel.but i am able to get for pdf in excel image is not printing
Title: Ireport set preset size   
Name: hyank
Date: 3/1/2008 5:53:54 AM
Comment:
Hello there
im newbie in ireport, i have a problem in set preset size manual outside ireport. i want user can choose the paper size when the report is printed. but i don't know the way??
can you help me??

thanks before
Title: Reports(To Himanshu....the question copier!)   
Name: Harilal
Date: 2/20/2008 11:53:07 AM
Comment:
Title: Feedback and facing problem
Name: Himanshu Jain
Date: 2/8/2008 6:07:32 AM
Comment:
This is really useful aricle for beginners and intermediate users.
Could anyuone help me out.

Now I face new problem related with the Bar Charts. In my project I commonly use Japer Reports to generate Report (with the help of i-report2.0). Now I need to represent some of the data’s in a chronological way. And for that purpose I select the Bar chart.
I have two values "Actual Data" And "Predicted Data", And I need to contrast these two values in My bar chart. But in i-Report I found only one option to set the values for the Bar Chart. In X-axis the object name and in Y-axis I set the Numbers. And I want to represent the Bar chart as the First bar repesent the predicted data and the neighbor bar represent the actual data...........
If any one has an idea or solution to this problem kindly give here
Thanks and Regadrs
Himanshu

First of all I am(Harilal.A.S.)very thankfull to Mr(?)"Himanshu" to ask this question why because this article is just I asked in the Java-Ranch forum....and i see that you copy the entire thing (that I asked in java ranch forum) and paste here......anyway if you got any answer post it in Java-Ranch Forums....as my anwer...........(and these type of copy the contents is not a right method....)
Title: Software Engineer   
Name: Abhishek
Date: 2/18/2008 10:53:56 AM
Comment:
Hi,

How are you?

I'm trying to export jasper report into pdf. But when I do that I get 25 pages with the same content.
I just need only once.

I'm using the subreport inside a master report.
I've two groups created.

So, can you please let me know how to take care of this?'
And, also can you please let me know how to reduce the white spaces between the columns and rows in the subreports?

Thanks in advance.
Title: Feedback and facing problem   
Name: Himanshu Jain
Date: 2/8/2008 6:07:32 AM
Comment:
This is really useful aricle for beginners and intermediate users.
Could anyuone help me out.

Now I face new problem related with the Bar Charts. In my project I commonly use Japer Reports to generate Report (with the help of i-report2.0). Now I need to represent some of the data’s in a chronological way. And for that purpose I select the Bar chart.
I have two values "Actual Data" And "Predicted Data", And I need to contrast these two values in My bar chart. But in i-Report I found only one option to set the values for the Bar Chart. In X-axis the object name and in Y-axis I set the Numbers. And I want to represent the Bar chart as the First bar repesent the predicted data and the neighbor bar represent the actual data...........
If any one has an idea or solution to this problem kindly give here
Thanks and Regadrs
Himanshu
Title: Date Display   
Name: Prabha
Date: 12/10/2007 1:09:52 AM
Comment:
Hi All,

I need to display the date in the final report. I am using xml datasource. In the field class type i have chosed java.util.Date. In the pattern iam choosing dd/MM/yyyy. In the xml file i have the value as 10/05/2007. But I am getting the error when executing the report.Can anyone help?

Error filling print... null
org.apache.commons.beanutils.ConversionException at org.apache.commons.beanutils.locale.BaseLocaleConverter.convert(BaseLocaleConverter.java :231) at org.apache.commons.beanutils.locale.LocaleConvertUtilsBean.convert(LocaleConvertUtilsBea n.java:249) at net.sf.jasperreports.engine.data.JRXmlDataSource.getFieldValue(JRXmlDataSource.java:342) at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:815) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:779) at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1105) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:111) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:763) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:688) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:517) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:960) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.NullPointerException at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:584) at java.text.SimpleDateFormat.applyPattern(SimpleDateFormat.java:1766) at net.sf.jasperreports.engine.util.JRDateLocaleConverter.parse(JRDateLocaleConverter.java: 83) at org.apache.commons.beanutils.locale.BaseLocaleConverter.convert(BaseLocaleConverter.java :225) ..
Title: Print 2 reports, in same pdf   
Name: Alberto Rosales
Date: 12/6/2007 11:56:13 AM
Comment:
hi,I need some helppppppp, I have created 2 reports from a java swing application, but now I have to print both reports in the same pdf File, how can I do it???
Title: chart   
Name: boikanyo
Date: 11/5/2007 9:25:14 AM
Comment:
thanks very much to Anuva......
i'm now able to walk through some things in ireports n jasper reports.........

thanks again bra...
Title: Jsp report   
Name: mudita
Date: 10/31/2007 1:28:40 AM
Comment:
hi all ,
i want to knw how i can create report in JSp..i m new ..so can nyone help me..
Title: nothing useful   
Name: Balaji
Date: 10/8/2007 9:25:20 AM
Comment:
Nothing is useful in this article
Title: Error   
Name: Gisela
Date: 10/1/2007 3:29:46 PM
Comment:
Hi!
How to use a java servlet page for the user to add a comment and reply to a comment.Could you please send me the sample code to my email address.
Thank you
Title: doubts regrading compliation and jsp page   
Name: Shailly
Date: 9/29/2007 3:54:20 AM
Comment:
Hi I am new to Jasper.
While compliing it , I am getting MAIN CONSOLE error as:
error loading configuration file.
plz tell me the way out.

how to use it in jsp page?

plz help with sample code.

my id: shailly@techmahindra.com
Title: Link from pdf to jsp page   
Name: priya
Date: 9/24/2007 3:06:56 AM
Comment:
Hi,

Is it possible to give link from a pdf report created to a jsp page , where I can pass the parameters of name=value pair type from pdf to jsp page
Title: Very Easy to Understand   
Name: Revathi
Date: 9/3/2007 8:00:08 AM
Comment:
Hi Anuva

This is first article which made me understand how iReport works. I am still exploring for new features amd also awaiting your nest Part I - Advanced Features.

Thanks
Title: ireport questions   
Name: mmus
Date: 8/23/2007 2:15:17 AM
Comment:
hi ! i`m the newbie in using ireport.. can u tell me where is the location of the jrxml file when u execute a report using i report?..

one more thing ..i also need sample code how to call this jrxml from jsp form through servlet?.. this is my email
hentamsaja82@yahoo.com

thanks in advanced
Title: reply to Sathesh kumar   
Name: Anuva
Date: 8/10/2007 5:45:54 AM
Comment:
create a JRXML or XML file using iReport.call this from servlet or jsp(which i already discussed in my article "creating report JasperReport") and then call this servlet or jsp in ur program.If u ve any doubt send ur mailling addres,so that i can send u a sample code.
Title: iReport in Eclipse   
Name: Sathesh kumar
Date: 8/10/2007 5:00:16 AM
Comment:
Is it possible to open the iReport in eclipse IDE?
Title: iReport Creation   
Name: Sathesh kumar
Date: 8/10/2007 4:47:04 AM
Comment:
This article is very useful for who are new in Bussiness Intelegence domain.
If you provide the details about how to call this report in server side program, It will very helpfull.
Title: ..   
Name: Peter
Date: 8/7/2007 3:54:50 AM
Comment:
Good article, just a pity, its not more extensive. But at least i started to understand little bit the things about iReport. Article recomended in sourceforge is piece of shit
Title: hyperlink on ireports   
Name: boikanyo
Date: 6/6/2007 7:04:58 AM
Comment:
hi.is it possible to have a tutorial on how to add hyperlinks on ireports.link that will maybe open a .doc or pdf or maybe some page.......

thanks
Title: thanks to anuva   
Name: boikanyo
Date: 5/25/2007 5:44:06 AM
Comment:
thank u very much,i had the same code but it worked out of a sudden after adding this other library.but hey ur help is much appriciated.
i convinced my boss dat jasper is de way so,my head is on the block im always looking 4 solutions and im new on this jasper thing so pls be patient when i ask lot of questions.
Title: Reply for boikanyo   
Name: Anuva
Date: 5/22/2007 2:23:19 AM
Comment:
Thanks.u can use above chart method to design ur chart,save it as .JRXML file.then use the following servlet code to create chart.

****************************************
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","demo","demo");

// load JasperDesign from XML and compile it into JasperReport
jasperDesign = JRXmlLoader.load("C:/report/ireportChart.jrxml");
jasperReport = JasperCompileManager.compileReport(jasperDesign);

// fill JasperPrint using fillReport() method
jasperPrint = JasperFillManager.fillReport(jasperReport,null,conn);

JasperExportManager.exportReportToPdfFile(jasperPrint,"C:/report/chart.pdf");
response.setContentType("application/pdf");

JasperExportManager.exportReportToPdfStream(jasperPrint, servletOutputStream);
servletOutputStream.flush();
servletOutputStream.close();
}
catch(SQLException sqle)
{
System.err.println(sqle.getMessage());
}
catch (ClassNotFoundException e)
{
System.err.println("No
Title: pdf   
Name: boikanyo
Date: 5/21/2007 7:24:28 AM
Comment:
ok.i realy apreciate this article as i learned much from it but i realy would apreciate it when it had a code to display it on a browser(including a chart) using pdf

Product Spotlight
Product Spotlight 






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


©Copyright 1998-2009 ASPAlliance.com  |  Page Processed at 11/21/2009 2:22:50 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search