Jump to content
JasperReports Library 7.0 is now available ×

Chart Creation thru iReport 0.4.0 - help


2004 IR Help

Recommended Posts

By: Ashok - k_s_ashok

Chart Creation thru iReport 0.4.0 - help

2004-10-13 05:33

Hi Giulio,

I tried to create Chart. But i got stuckup.

In the Chart Properties - What is Data Option and Report Series ?

How can i pass my query result value for chart creation ?

 

 

 

 

By: Ashok - k_s_ashok

RE: Chart Creation thru iReport 0.4.0 - help

2004-10-14 22:23

Hi Giulio, Any update ?

 

 

 

 

By: Giulio Toffoli - gt78

RE: Chart Creation thru iReport 0.4.0 - help

2004-10-17 13:37

You have to put tools.jar from your JDK into iReport lib directory

 

Giulio

 

 

 

 

By: rockmuncher - rockmuncher

RE: Chart Creation thru iReport 0.4.0 - help

2004-10-17 20:27

Giulio, I'm looking forward to the tutorial. In the mean time I have a

related "what did I do wrong?" question.

 

I have a basic report with report query set to

 

select group_name, count(site_code) as sites

from prop_group a, prop_site_group b

where group_type=9

and a.group_code=b.group_code

group by group_name

 

There are no grouping levels on the report, just detail. Detail

contains a chart which has pie chart type selected, $F{GROUP_NAME} as Label

series and $F{SITES} as Serie1 series.

 

My report prints chart nicely, first with 1 GROUP_NAME element, then 2,

3, 4, until it reaches max GROUP_NAME elements (which is how it should

look). Why am I not getting just the last chart?

 

 

 

 

 

By: rockmuncher - rockmuncher

RE: Chart Creation thru iReport 0.4.0 - help

2004-10-17 20:35

Re my last post:

 

The report does out as expected if the chart is inserted into the

Report Summary section only (ie. not in the Detail section).

 

Is that how charts are intended to be used? In Summary and Footer

sections?

 

 

 

 

 

 

By: djiska - djiska

RE: Chart Creation thru iReport 0.4.0 - help

2004-10-18 14:55

Hi Giulio

 

It is true. The tools.jar has been forgotten to me. Also, I put the

charts in footer section and not in Sumary section. Now I think I have put

it in its place but it still gives me a Exception and it is different.

 

594955?[Thread-9]?ERROR?digester.Digester??-?End?event?threw?exception

java.lang.reflect.InvocationTargetException

????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:324)

????at?org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:250)

????at?org.apache.commons.digester.SetNextRule.end(SetNextRule.java:260)

????at?org.apache.commons.digester.Digester.endElement(Digester.java:1036)

????at?org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown?Source)

????at?org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown?Source)

????at?org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown?Source)

????at?org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown?Source)

????at?org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown?Source)

????at?org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown?Source)

????at?org.apache.xerces.parsers.XML11Configuration.parse(Unknown?Source)

????at?org.apache.xerces.parsers.DTDConfiguration.parse(Unknown?Source)

????at?org.apache.xerces.parsers.XMLParser.parse(Unknown?Source)

????at?org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown?Source)

????at?org.apache.commons.digester.Digester.parse(Digester.java:1514)

????at?net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:400)

????at?net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:384)

????at?net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:338)

????at?net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:322)

????at?net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:128)

????at?it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:336)

????at?java.lang.Thread.run(Thread.java:536)

Caused?by:?net.sf.jasperreports.engine.JRException:?Duplicate?declaration?of?parameter?:?REPORT_DATA_SOURCE

????at?net.sf.jasperreports.engine.design.JasperDesign.addParameter(JasperDesign.java:671)

????...?25?more java.lang.reflect.InvocationTargetException

????at?org.apache.commons.digester.Digester.createSAXException(Digester.java:2312)

????at?org.apache.commons.digester.Digester.createSAXException(Digester.java:2332)

????at?org.apache.commons.digester.Digester.endElement(Digester.java:1039)

????at?org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown?Source)

????at?org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown?Source)

????at?org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown?Source)

????at?org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown?Source)

????at?org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown?Source)

????at?org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown?Source)

????at?org.apache.xerces.parsers.XML11Configuration.parse(Unknown?Source)

????at?org.apache.xerces.parsers.DTDConfiguration.parse(Unknown?Source)

????at?org.apache.xerces.parsers.XMLParser.parse(Unknown?Source)

????at?org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown?Source)

????at?org.apache.commons.digester.Digester.parse(Digester.java:1514)

????at?net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:400)

????at?net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:384)

????at?net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:338)

????at?net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:322)

????at?net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:128)

????at?it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:336)

????at?java.lang.Thread.run(Thread.java:536) NESTED?BY?:

net.sf.jasperreports.engine.JRException:?Error?at?(24,?88:?null

????at?net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:404)

????at?net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:384)

????at?net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:338)

????at?net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:322)

????at?net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:128)

????at?it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:336)

????at?java.lang.Thread.run(Thread.java:536)

Caused?by:?java.lang.reflect.InvocationTargetException

????at?org.apache.commons.digester.Digester.createSAXException(Digester.java:2312)

????at?org.apache.commons.digester.Digester.createSAXException(Digester.java:2332)

????at?org.apache.commons.digester.Digester.endElement(Digester.java:1039)

????at?org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown?Source)

????at?org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown?Source)

????at?org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown?Source)

????at?org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown?Source)

????at?org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown?Source)

????at?org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown?Source)

????at?org.apache.xerces.parsers.XML11Configuration.parse(Unknown?Source)

????at?org.apache.xerces.parsers.DTDConfiguration.parse(Unknown?Source)

????at?org.apache.xerces.parsers.XMLParser.parse(Unknown?Source)

????at?org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown?Source)

????at?org.apache.commons.digester.Digester.parse(Digester.java:1514)

????at?net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:400)

????...?6?more

 

If do you have got any idea of this Exception? also you help me so

much.

 

Thank you very much for your reponds of over. And see you.

 

 

 

 

 

 

By: Giulio Toffoli - gt78

RE: Chart Creation thru iReport 0.4.0 - help

2004-10-19 09:31

 

Perhaps you have declared the built in Parameter: REPORT_DATA_SOURCE

 

remove it from your parameters

 

Giulio

 

 

 

 

By: Alessandro - alebr

RE: Chart Creation thru iReport 0.4.0 - help

2004-10-20 12:40

Hi,

We wanna do a Stacked Chart with 3 series with iReport 0.4.0 (Chart

tool):

- 2 bar series(stacked);

- 1 line series (combined with stacked)

Can you help us ! How much costs to you make an example ???

We really need do that !!!

 

 

 

 

By: djiska - djiska

RE: Chart Creation thru iReport 0.4.0 - help

2004-10-20 09:39

Hello Giulio again.

 

I have deleted the parameter REPORT_DATA_SOURCE. Now it doesn't give me

any errors. But the chart is empty. I don't know why?. the query has

got datas.

 

thank you very much. greets

 

 

 

 

 

 

By: Matteo - jyotaro

RE: Chart Creation thru iReport 0.4.0 - help

2004-10-21 00:37

I have had tha same problem. The problem was the dimension of the

chart. Modifing them as x 545 and y 757, I was able to view the data.

 

I hope this help you.

Bye,

Matteo

 

 

 

 

By: djiska - djiska

RE: Chart Creation thru iReport 0.4.0 - help

2004-10-21 14:30

Hi guys

 

I have not found the option x,y. I suppose it is width 545 and height

757. if is it so?, I run and it happens the same. it doesn't show

anything.

 

any idea?

 

thank you very much for your help.

 

 

 

 

 

By: djiska - djiska

RE: Chart Creation thru iReport 0.4.0 - help

2004-10-25 16:05

hi again.

 

I have tested the thread the before. And it doesn't work. I can not

change the screen resolution of my monitor. I am running the reports with

chart to (800,600). it can be that why doesn't it work?. Have somebody

tested this option?, if someone does it, it would be to me the grant

help.

 

thank you.

 

 

 

 

By: MBincole - mbincole

RE: Chart Creation thru iReport 0.4.0 - help

2004-11-02 07:47

Ciao a tutti,

 

I've tried to build-up a report with a chart in the lastPageFooter but

when I make the whole document, iReport 0.4.0 can't display the chart

correctly. I can see only the grid on the axis...

 

I think I haven't set all the parameters...

 

Now I ask, could someone ( with a simple example ) make a short

demonstration and show how to build one?

 

Thanks to everyone who read.

 

 

 

MBincole

 

 

 

 

By: djiska - djiska

RE: Chart Creation thru iReport 0.4.0 - help

2004-10-25 15:44

Hi

 

I am trying to do that works. But it still don't work. Maybe it can be

for the jdk. I am using the jdk1.4.1.

 

thank you

 

 

 

 

By: duhu - duhu

RE: Chart Creation thru iReport 0.4.0 - help

2004-12-14 00:34

I have a problem like this one. I can make a report with a chart in

iReport and it runs ok, but if I run it from a JSP page I get an error

like this:

 

org.apache.jasper.JasperException: Error evaluating expression :

image_1

Source text :

(java.awt.Image)it.businesslogic.ireport.chart.DefaultChartFactory.drawChart(new

String[]{"chartName=Pie3D","depthFactor=0.2","titlePosition=1","width=227","serie1=SERIE_numeros","plotBackground=[255,255,255]","serie0=SERIE_nombres","foregroundAlpha=0.33","tooltips=false","chartBackground=[255,255,255]","subtitle=","title=","legend=false","quality=2","height=170","antialias=true"},

(it.businesslogic.ireport.IReportScriptlet)$P{REPORT_SCRIPTLET})

at

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)

at

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:24

(...)

 

 

The code of my JSP is:

 

<%

File reportFile = new

File(application.getRealPath("/reports/prueba3.jasper"));

JasperReport jasperReport =

(JasperReport)JRLoader.loadObject(reportFile.getPath());

Map parameters = new HashMap();

//parameters.put("REPORT_SCRIPTLET", new pruebaScriptlet());

//parameters.put("chart-1", createEmployeeChartImage());

//parameters.put("BaseDir", reportFile.getParentFile());

Context context = new InitialContext();

DataSource dataSource =(DataSource)context.lookup("java:jdbc/prueba");

Connection conexion = dataSource.getConnection();

 

JasperPrint jasperPrint =

JasperFillManager.fillReport(jasperReport,parameters,conexion);

JRHtmlExporter exporter = new JRHtmlExporter();

 

StringBuffer sbuffer = new StringBuffer();

 

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out);

 

exporter.exportReport();

%>

 

 

 

 

By: Delia - ce_medinadelia

RE: Chart Creation thru iReport 0.4.0 - help

2005-02-15 13:36

I have a problem like this one. I can make a report with a chart in

iReport and it runs ok, but if I run it from a JSP page I get an error

like this:

 

And i have in the classpath the iReport.jar

 

 

C:jakarta-tomcat-4.1.30webappssappiereporteresumenreporte_resumen.java:137:

package it.busines

slogic.ireport does not exist

value =

(java.awt.Image)((java.awt.Image)it.businesslogic.ireport.chart.DefaultChart

Factory.drawChart(new

String[]{"antialias=true","tooltips=false","legend=false","chartName=Bar3D","p

lotOrientation=2","foregroundAlpha=0.33","valueLabel=Serie1","subtitle=","plotBackground=[255,255,25

5]","quality=1","height=139","titlePosition=1","chartBackground=[255,255,255]","width=488","serie2=S

ERIE_Serie_Ejecutado","serie1=SERIE_Seri_listado","serie0=SERIE_Serie_Mes","categoryLabel=Serie2","t

itle="},

(it.businesslogic.ireport.IReportScriptlet)((net.sf.jasperreports.engine.JRAbstractScriptle

t)parameter_REPORT_SCRIPTLET.getValue())));

 

 

 

 

By: djiska - djiska

RE: Chart Creation thru iReport 0.4.0 - help

2004-10-16 14:10

Hi Giulio

 

I have got the same trouble this guy. I try to create a chart. But it

doesn't work. I describe you, I am doing. Maybe I am making a bad step.

I am sure that last :).

1) I create the query (DataSource-> Report query).fe:

SELECT ASIGNATURA_MATRI_P.NOTA10

FROM ASIGNATURA_MATRI_P

GROUP BY ASIGNATURA_MATRI_P.NOTA10

 

2) I create with chart tool a chart.

3) I select the first kind.(Properties->Chart->Edit chart properties->

chart type).

4) I insert in Serie1 (SERIE_Aprobado, SERIE_Suspenso, SERIE_Notable,

SERIE_Sobresaliente, SERIE_NoPresentado).

 

It is from here when I have got all my doubts. I compile it and it

gives me this exceptions:

Error compiling the Scriptlet java source!

java.lang.ClassNotFoundException:?com.sun.tools.javac.Main

????at?java.net.URLClassLoader$1.run(URLClassLoader.java:198)

????at?java.security.AccessController.doPrivileged(Native?Method)

????at?java.net.URLClassLoader.findClass(URLClassLoader.java:186)

????at?java.lang.ClassLoader.loadClass(ClassLoader.java:299) ????at?sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)

????at?java.lang.ClassLoader.loadClass(ClassLoader.java:255)

????at?java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)

????at?java.lang.Class.forName0(Native?Method)

????at?java.lang.Class.forName(Class.java:217)

????at?net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:116)

????at?net.sf.jasperreports.engine.design.JRJdk13Compiler.compileClass(JRJdk13Compiler.java:111)

????at?it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:233)

????at?java.lang.Thread.run(Thread.java:536) NESTED?BY?:

net.sf.jasperreports.engine.JRException:?Error?compiling?report?java?source?file?:?C:Documents?and?SettingsAdministrador.ireporthistogramas_quesoScriptlet.java

????at?net.sf.jasperreports.engine.design.JRJdk13Compiler.compileClass(JRJdk13Compiler.java:124)

????at?it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:233)

????at?java.lang.Thread.run(Thread.java:536)

Caused?by:?java.lang.ClassNotFoundException:?com.sun.tools.javac.Main

????at?java.net.URLClassLoader$1.run(URLClassLoader.java:198)

????at?java.security.AccessController.doPrivileged(Native?Method)

????at?java.net.URLClassLoader.findClass(URLClassLoader.java:186)

????at?java.lang.ClassLoader.loadClass(ClassLoader.java:299)

????at?sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)

????at?java.lang.ClassLoader.loadClass(ClassLoader.java:255) ????at?java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)

????at?java.lang.Class.forName0(Native?Method)

????at?java.lang.Class.forName(Class.java:217)

????at?net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:116)

????at?net.sf.jasperreports.engine.design.JRJdk13Compiler.compileClass(JRJdk13Compiler.java:111)

 

I know the problem is in the scriptle. But I don't know if I have got

to write something there (scriptle experimental) or in

(properties->common->Print when Expresion). And what do I write?. fe. the thread over,

the parameter REPORT_SCRIPTLET, I don't have got it. I have got to

create it or with the formulas of expression editor is enouph. But there are

anothers parameters whitch I don't know How to inicialice it. I don't

know if you understand me.

 

I have got to give you the congratulations for this application.

Because it is very good tool.

 

I hope your respond. greets,

 

 

 

 

 

 

By: Mufasa - mufasa

RE: Chart Creation thru iReport 0.4.0 - help

2005-01-04 13:37

Same problem here too...

 

 

 

 

By: Narso - narso

RE: Chart Creation thru iReport 0.4.0 - help

2005-07-20 13:48

I had the same problem too. All you have to do is add tools.jar (from

the JDK's 'lib' directory) to the iReports classpath. To do this in

iReport, go to Tools->Classpath and locate tools.jar in the JDK directory.

 

Hope this helps. :)

 

 

 

 

By: Giulio Toffoli - gt78

RE: Chart Creation thru iReport 0.4.0 - help

2004-10-15 04:18

 

No query to make a serie.

You can create an iReport handled serie sepcifing a field or an

expression to collect.

For each record, iReport will take the expression value and it'll put

in a Vector.

 

An iReport serie is simply a Vector.

 

You can handle your own serie using IReportScriptlet: suppose to want

create a serie of FIELD1, put a fake element like a line in details, set

as PrintWhenExpression this expression:

 

((it.businesslogic.ireport.IReportScriptlet)$P{REPORT_SCRIPTLET}).addValueToSerie("MySerie",

$F{FIELD1})

 

Set MySerie as Serie1 in chart properties.

 

If this is not clear, please wait the tutorial, I'm looking for a pair

of hours to write it... :-)

 

Giulio

 

 

 

 

 

 

By: Narso - narso

RE: Chart Creation thru iReport 0.4.0 - help

2005-07-20 15:20

Thanks! This was a big help in creating a custom series using report

variables (sums) that I had made. I'm sure it would be a lot nicer if we

could create custom series using an intuitive GUI system instead of

hiding the code in expressions in line elements, though. ;) Just a

suggestion/ feature request.

 

 

 

 

By: Narso - narso

RE: Chart Creation thru iReport 0.4.0 - help

2005-07-20 15:22

Also, it would be great to put instructions for creating non-field

series on the tutorial page... It was really a pain to have to wade through

the forums just to find out this information.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...