Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

iReport, jrxml i eclipse europa

[es] :: Java :: iReport, jrxml i eclipse europa

[ Pregleda: 3974 | Odgovora: 12 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

nenadvuci
Beograd

Član broj: 163299
Poruke: 8
89.110.196.*



Profil

icon iReport, jrxml i eclipse europa13.01.2008. u 13:33 - pre 167 meseci
Zdravo,

Koristim Eclipse 3.3 i imam ogroman problem u pokretanju jrxml reporta.

napravio sam jrxml file bez podataka samo za primer,
i pokrenuo ga u kodu sa

try {
Class.forName(driverName);
Connection conn = DriverManager.getConnection(dbURL , user, pass);
//JOptionPane.showMessageDialog(null,"Konektovali smo se na bazu!" );
// konekcija provereno radi

PreparedStatement ps = conn.prepareStatement("select PAR_ID, PIB from PAR");
ResultSet res = ps.executeQuery();

Map model = new HashMap();
model.put("pib", "1");

try{
JasperDesign jasperDesign = JRXmlLoader.load("report_1.jrxml");
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
// e ovaj compileReport() izbaci exception!!!!!! Sta mu je!!!!!

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, model, conn);
JasperViewer.viewReport(jasperPrint, false);
}catch(Exception ex) {
String connectMsg = "Could not create the report " + ex.getMessage() + " " + ex.getLocalizedMessage();
System.out.println(connectMsg);
}


ali dobijam:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/log4j/ConsoleAppender
at org.apache.commons.logging.impl.Log4JCategoryLog.initialize(Log4JCategoryLog.java:132)
at org.apache.commons.logging.impl.Log4JCategoryLog.<init>(Log4JCategoryLog.java:118)
at org.apache.commons.logging.impl.Log4jFactory.getInstance(Log4jFactory.java:153)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:285)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:409)
at org.apache.commons.digester.Digester.<init>(Digester.java:304)
at net.sf.jasperreports.engine.xml.JRXmlDigester.<init>(JRXmlDigester.java:62)
at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createDigester(JRXmlDigesterFactory.java:980)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:203)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:168)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152)
at imenik.Imenik.PrikazMouseClicked(Imenik.java:129)
at imenik.Imenik.access$1(Imenik.java:113)
at imenik.Imenik$2.mouseClicked(Imenik.java:104)
at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


U cemu je caka, izludecu!!!!!


Pozdrav
 
Odgovor na temu

nenadvuci
Beograd

Član broj: 163299
Poruke: 8
89.110.196.*



Profil

icon Re: iReport, jrxml i eclipse europa13.01.2008. u 14:09 - pre 167 meseci
A sada probam sledece i dobijam isto!!!


import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;

public class FirstReportCompile
{
public static void main(String[] args) throws JRException
{
//jasperReport = JasperCompileManager.compileReport("reports/rep1.jrxml");

JasperCompileManager.compileReportToFile("reports/rep1.jrxml","reports/rep1.jasper");

//jasperPrint = JasperFillManager.fillReport(
// jasperReport, new HashMap(), new JREmptyDataSource());
//JasperExportManager.exportReportToPdfFile(jasperPrint, "reports/rep1.pdf");
}
}


----------------------
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/ConsoleAppender
at org.apache.commons.logging.impl.Log4JCategoryLog.initialize(Log4JCategoryLog.java:132)
at org.apache.commons.logging.impl.Log4JCategoryLog.<init>(Log4JCategoryLog.java:118)
at org.apache.commons.logging.impl.Log4jFactory.getInstance(Log4jFactory.java:153)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:285)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:409)
at org.apache.commons.digester.Digester.<init>(Digester.java:304)
at net.sf.jasperreports.engine.xml.JRXmlDigester.<init>(JRXmlDigester.java:62)
at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createDigester(JRXmlDigesterFactory.java:980)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:203)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:168)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:116)
at FirstReportCompile.main(FirstReportCompile.java:20)
----------------------------

Dakle, JasperCompileManager.compileReportToFile(), ne prolazi!!!
Nije mi jasno u cemu je stvar!?

 
Odgovor na temu

Dejan Lozanovic
Dejan Lozanovic
Beograd

Član broj: 691
Poruke: 2325
*.adsl.beotel.net.

Jabber: null@elitesecurity.org
Sajt: speedy-order.com


+75 Profil

icon Re: iReport, jrxml i eclipse europa13.01.2008. u 23:53 - pre 167 meseci
ocigledno nisi dodao sve jar-ove koji su potrebni jasper reports-u.
 
Odgovor na temu

korisnicko_ime

Član broj: 38909
Poruke: 113
79.101.145.*



+3 Profil

icon Re: iReport, jrxml i eclipse europa14.01.2008. u 01:39 - pre 167 meseci
Mislim da ovo treba dodati za osnovni prikaz o izvestaju:

* commons-beanutils-1.5.jar
* commons-collections-2.1.jar
* commons-digester-1.7.jar
* commons-logging-1.0.2.jar
* commons-javaflow-20060411.jar

naravno 1.5 moze da bude i 2.04. u zavisnosti od verzije jasperreport-a
 
Odgovor na temu

nenadvuci
Beograd

Član broj: 163299
Poruke: 8
*.yubc.net.



Profil

icon Re: iReport, jrxml i eclipse europa14.01.2008. u 08:55 - pre 167 meseci
Pozdrav
Citat:
Dejan Lozanovic: ocigledno nisi dodao sve jar-ove koji su potrebni jasper reports-u.



commons-beanutils-1.7.jar
commons-collections-2.1.jar
commons-digester-1.7.jar
commons-logging-1.0.2.jar
commons-logging-api-1.0.2.jar

se nalaze u jdk-u i jre-u, koristim jdk 1.5, a probao sam da dodam u jdk-ov lib sve iz ./jasperreports-2.0.3/lib ali ista stvar.

Inace org/apache/log4j/ConsoleAppender je iz log4j jar-a a imam

org.apache.log4j_1.2.13.v200706111418.jar u d:\eclipse\plugins\
ant-apache-log4j.jar u D:\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib
log4j.properties u D:\eclipse\plugins\org.apache.axis_1.4.0.v200706191647\lib

probacu da dodam njih na classpath pa da vidimo!?


 
Odgovor na temu

Dejan Lozanovic
Dejan Lozanovic
Beograd

Član broj: 691
Poruke: 2325
*.dynamic.sbb.co.yu.

Jabber: null@elitesecurity.org
Sajt: speedy-order.com


+75 Profil

icon Re: iReport, jrxml i eclipse europa14.01.2008. u 11:33 - pre 167 meseci
Proveri da li su verzije iste, mozda imas stariju verziju log4j, imao sam slican problem da smo imali neku strariju verziju iText-a u projektu, pa je to pravilo probleme jer pdf export nije radio. U principu dodaj sve sto im je u lib direktorijumu pa probaj onda.
 
Odgovor na temu

nenadvuci
Beograd

Član broj: 163299
Poruke: 8
*.yubc.net.



Profil

icon Re: iReport, jrxml i eclipse europa14.01.2008. u 14:55 - pre 167 meseci
Izludece me ovaj Jasper :/ Nasao sam log4j-1.2.15.jar i dodao ga u build path

Sada na sledeci kod:

package test;

import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;

public class JasperReportsCompileTest {

public static void main(String[] args) throws JRException {
JasperCompileManager.compileReportToFile("reports/new_report.jrxml","reports/new_report.jasper");
}

}

Dobijam:

Exception in thread "main" net.sf.jasperreports.engine.JRException: Error compiling report java source files : E:\workspace\JasperTest\Unnamed_1200322489214_796291.java
at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:93)
at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileUnits(JRAbstractClassCompiler.java:67)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:190)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:220)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:136)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:118)
at test.JasperReportsCompileTest.main(JasperReportsCompileTest.java:9)
Caused by: java.io.IOException: CreateProcess: javac -classpath "E:\workspace\JasperTest\bin;C:\Program Files\Java\jdk1.5.0_14\lib\commons-logging-1.0.2.jar;C:\Program Files\Java\jdk1.5.0_14\lib\commons-beanutils-1.7.jar;C:\Program Files\Java\jdk1.5.0_14\lib\commons-collections-2.1.jar;C:\Program Files\Java\jdk1.5.0_14\lib\commons-digester-1.7.jar;C:\Program Files\Java\jdk1.5.0_14\lib\commons-javaflow-20060411.jar;C:\Program Files\Java\jdk1.5.0_14\lib\log4j-1.2.15.jar;C:\Program Files\Java\jdk1.5.0_14\lib\jasperreports-2.0.4-javaflow.jar;C:\Program Files\Java\jdk1.5.0_14\lib\jasperreports-2.0.4.jar;C:\Program Files\Java\jdk1.5.0_14\lib\jasperreports-2.0.4-applet.jar" E:\workspace\JasperTest\Unnamed_1200322489214_796291.java error=2
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:62)
... 6 more

Zivo me zanima otkud mu E:\workspace\JasperTest\Unnamed_1200322489214_796291.java !!!
Odakle ga dodade u javac -classpath ?!?!?!




 
Odgovor na temu

Dejan Lozanovic
Dejan Lozanovic
Beograd

Član broj: 691
Poruke: 2325
*.dynamic.sbb.co.yu.

Jabber: null@elitesecurity.org
Sajt: speedy-order.com


+75 Profil

icon Re: iReport, jrxml i eclipse europa14.01.2008. u 18:12 - pre 167 meseci
:) Ti znaci jos uvek ne znas koliko je sam Jasper jako mocan alat, on zapravo svaki report konvertuje u java fajl, i nakon toga kompajlira java fajl i dobijes sam report.

E sada prvo i osnovno pitanje dalje, dali si setovao JAVA_HOME environment promenljivu i da li si dodao JAVA_HOME/bin u PATH ?
 
Odgovor na temu

nenadvuci
Beograd

Član broj: 163299
Poruke: 8
*.ptt.yu.



Profil

icon Re: iReport, jrxml i eclipse europa14.01.2008. u 19:42 - pre 167 meseci
Upravo sam malo googlao i shvatio kako jasper radi :) Upravo to ocemu pricas.

Interesantno!

Sada sve radi i mogu slobodno da se prepustim carima "report-iranja"

Hvala svima koji su mi pomogli!

Pozz
 
Odgovor na temu

Dejan Lozanovic
Dejan Lozanovic
Beograd

Član broj: 691
Poruke: 2325
*.dynamic.sbb.co.yu.

Jabber: null@elitesecurity.org
Sajt: speedy-order.com


+75 Profil

icon Re: iReport, jrxml i eclipse europa15.01.2008. u 10:54 - pre 167 meseci
E sada zamisli samo da u sam report ubacujes svoje metode koje vracaju String ili neki drugi podatak koji mora da se racuna na neki nacin :), tada stvari zaista postaju vrlo interesantne. Mada kada su grafofi u pitanju, trebace ti i znanje JFreeCharta ako hoces da nad grafovima napravis customizacije do kraja, kakve recimo mozes da napravis u Crystal Report-u
 
Odgovor na temu

korisnicko_ime

Član broj: 38909
Poruke: 113
79.101.150.*



+3 Profil

icon Re: iReport, jrxml i eclipse europa15.01.2008. u 21:27 - pre 167 meseci
vrlo uskoro ce se pojaviti i nova verzija iReports-a, dostupan je i plagin za netbeans

http://www.jasperforge.org/jas...report/page.php?name=iReportNB
 
Odgovor na temu

Javan
developer, programer
novi sad, srbija

Član broj: 233923
Poruke: 1
*.univerexport.co.yu.



Profil

icon Re: iReport, jrxml i eclipse europa08.10.2009. u 11:46 - pre 146 meseci
za:
nenadvuci,
Dejan Lozanovic

Hvala sto ispisali ovu temu.
Poceo sam da koristim Jasper pre par nedelja, i odmah sam naleteo na iste pocetnicke probleme:
ovakve:
Exception in thread "main" java.lang.NoClassDefFoundError: itd....
a pogoto ovakve:
Izludece me ovaj Jasper :/


Vec sam dovoljno izludeo da sam hteo da odustanem i da predjem na kristal reports ili nesto trece
a onda sam guglovao "Exception in thread "main" java.lang.NoClassDefFoundError: ..."
i iskocila mi je ova tema.

Jeste da je proslo dve godine, ali za mene je bilo vrlo aktuelno
hvala hvala hvala.




javan
 
Odgovor na temu

nenadvuci
Beograd

Član broj: 163299
Poruke: 8
*.mediaworksit.net.



Profil

icon Re: iReport, jrxml i eclipse europa08.10.2009. u 12:31 - pre 146 meseci
Pa za to i sluze forumi!!! Nisu oni samo za experte vec i za pocetnike.

Znas kako narod kaze " Ko nema u glavi ima na googlavi" :))))

Pozdrav i tebi i Univerexportu :) (vidim da pises sa tog domena)
 
Odgovor na temu

[es] :: Java :: iReport, jrxml i eclipse europa

[ Pregleda: 3974 | Odgovora: 12 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.