Jump to content
We've recently updated our Privacy Statement, available here ×

patrick24

Members
  • Posts

    9
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by patrick24

  1. hi all, I try go create simple jasperreport and fill him with 2table valuse. problem is that i canno't get values from table adressen. here is my code. package model; // default package // Generated 22.09.2008 09:49:57 by Hibernate Tools 3.2.1.GA import java.util.ArrayList; import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; /** * Beleg generated by hbm2java */ public class Beleg implements java.io.Serializable { private String belegid; private String adressid; private Date datum; private Float netto; private Float mwst; private Integer rabatt; private Integer zbid; private byte[] vortext; private byte[] nachtext; private String bemerkung; private Integer ausgewaehlt; private Float bezahlt; private String oztyp; private int status; private Adressen adressen; private Belegpos bp; //beleg 1 : n Belegpos private Set<Belegpos> belegpos=new HashSet<Belegpos>(); //private List<Belegpos> belegpos = new ArrayList<Belegpos>(); public Beleg() { } public Beleg(String belegid, String adressid, int status) { this.belegid = belegid; this.adressid = adressid; this.status = status; } public Beleg(String belegid, String adressid, Date datum, Float netto, Float mwst, Integer rabatt, Integer zbid, byte[] vortext, byte[] nachtext, String bemerkung, Integer ausgewaehlt, Float bezahlt, String oztyp, int status) { this.belegid = belegid; this.adressid = adressid; this.datum = datum; this.netto = netto; this.mwst = mwst; this.rabatt = rabatt; this.zbid = zbid; this.vortext = vortext; this.nachtext = nachtext; this.bemerkung = bemerkung; this.ausgewaehlt = ausgewaehlt; this.bezahlt = bezahlt; this.oztyp = oztyp; this.status = status; } public String getBelegid() { return this.belegid; } public void setBelegid(String belegid) { this.belegid = belegid; } public String getAdressid() { return this.adressid; } public void setAdressid(String adressid) { this.adressid = adressid; } public Date getDatum() { return this.datum; } public void setDatum(Date datum) { this.datum = datum; } public Float getNetto() { return this.netto; } public void setNetto(Float netto) { this.netto = netto; } public Float getMwst() { return this.mwst; } public void setMwst(Float mwst) { this.mwst = mwst; } public Integer getRabatt() { return this.rabatt; } public void setRabatt(Integer rabatt) { this.rabatt = rabatt; } public Integer getZbid() { return this.zbid; } public void setZbid(Integer zbid) { this.zbid = zbid; } public byte[] getVortext() { return this.vortext; } public void setVortext(byte[] vortext) { this.vortext = vortext; } public byte[] getNachtext() { return this.nachtext; } public void setNachtext(byte[] nachtext) { this.nachtext = nachtext; } public String getBemerkung() { return this.bemerkung; } public void setBemerkung(String bemerkung) { this.bemerkung = bemerkung; } public Integer getAusgewaehlt() { return this.ausgewaehlt; } public void setAusgewaehlt(Integer ausgewaehlt) { this.ausgewaehlt = ausgewaehlt; } public Float getBezahlt() { return this.bezahlt; } public void setBezahlt(Float bezahlt) { this.bezahlt = bezahlt; } public String getOztyp() { return this.oztyp; } public void setOztyp(String oztyp) { this.oztyp = oztyp; } public int getStatus() { return this.status; } public void setStatus(int status) { this.status = status; } public Adressen getAdressen() { return adressen; } public void setAdressen(Adressen adressen) { this.adressen = adressen; } public Set<Belegpos> getBelegpos() { return belegpos; } public void setBelegpos(Set<Belegpos> belegpos) { this.belegpos = belegpos; } public Belegpos getBp() { return bp; } public void setBp(Belegpos bp) { this.bp = bp; } } package model; // default package // Generated 22.09.2008 09:49:57 by Hibernate Tools 3.2.1.GA import java.util.Date; import java.util.HashSet; import java.util.Set; /** * Adressen generated by hbm2java */ public class Adressen implements java.io.Serializable { private String adressid; private String kurzname; private String anrede; private String name; private String strasse; private String plz; private String ort; private String vorwahl; private String telefon; private String fax; private String email; private String unsereKdnr; private byte[] notiz; private String blz; private String konto; private Date geburtstag; private Integer status; //1:n Adressen : Belegpos private Set<Beleg> beleg=new HashSet<Beleg>(); public Adressen() { } public Adressen(String adressid) { this.adressid = adressid; } public Adressen(String adressid, String kurzname, String anrede, String name, String strasse, String plz, String ort, String vorwahl, String telefon, String fax, String email, String unsereKdnr, byte[] notiz, String blz, String konto, Date geburtstag, Integer status) { this.adressid = adressid; this.kurzname = kurzname; this.anrede = anrede; this.name = name; this.strasse = strasse; this.plz = plz; this.ort = ort; this.vorwahl = vorwahl; this.telefon = telefon; this.fax = fax; this.email = email; this.unsereKdnr = unsereKdnr; this.notiz = notiz; this.blz = blz; this.konto = konto; this.geburtstag = geburtstag; this.status = status; } public String getAdressid() { return this.adressid; } public void setAdressid(String adressid) { this.adressid = adressid; } public String getKurzname() { return this.kurzname; } public void setKurzname(String kurzname) { this.kurzname = kurzname; } public String getAnrede() { return this.anrede; } public void setAnrede(String anrede) { this.anrede = anrede; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getStrasse() { return this.strasse; } public void setStrasse(String strasse) { this.strasse = strasse; } public String getPlz() { return this.plz; } public void setPlz(String plz) { this.plz = plz; } public String getOrt() { return this.ort; } public void setOrt(String ort) { this.ort = ort; } public String getVorwahl() { return this.vorwahl; } public void setVorwahl(String vorwahl) { this.vorwahl = vorwahl; } public String getTelefon() { return this.telefon; } public void setTelefon(String telefon) { this.telefon = telefon; } public String getFax() { return this.fax; } public void setFax(String fax) { this.fax = fax; } public String getEmail() { return this.email; } public void setEmail(String email) { this.email = email; } public String getUnsereKdnr() { return this.unsereKdnr; } public void setUnsereKdnr(String unsereKdnr) { this.unsereKdnr = unsereKdnr; } public byte[] getNotiz() { return this.notiz; } public void setNotiz(byte[] notiz) { this.notiz = notiz; } public String getBlz() { return this.blz; } public void setBlz(String blz) { this.blz = blz; } public String getKonto() { return this.konto; } public void setKonto(String konto) { this.konto = konto; } public Date getGeburtstag() { return this.geburtstag; } public void setGeburtstag(Date geburtstag) { this.geburtstag = geburtstag; } public Integer getStatus() { return this.status; } public void setStatus(Integer status) { this.status = status; } public Set<Beleg> getBeleg() { return beleg; } public void setBeleg(Set<Beleg> beleg) { this.beleg = beleg; } } String sampleReportFile=new String("E:/eclipse3.4/Handwerk2008/src/JasperReports/testBeleg.xml"); //List belege=null; try{ begin(); List belege= getSession().createQuery("select b from Beleg b join b.adressen join b.belegpos where b.belegid='RA004805'").list(); //wypelnia parametry HashMap parameters= new HashMap(); parameters.put("titel", "Rechnung"); //laduje z pliku xml do .jasper JasperDesign design=JRXmlLoader.load(sampleReportFile); //kompiluje JasperReport report= new JasperCompileManager().compileReport(design); //wypelnia raport uzywajac metody... JasperPrint print= JasperFillManager.fillReport(report, parameters, new JRBeanCollectionDataSource(belege)); // //export do pdf JasperExportManager.exportReportToPdfFile(print, "testBeleg.pdf"); //commit(); System.out.println("Datei wurde gespeichert" ); }catch(JRException jre){ jre.printStackTrace(); } catch(MappingException me){ me.printStackTrace(); } catch(HibernateException he){ he.printStackTrace(); } } <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="testBeleg" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="555" columnSpacing="0" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="0" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <reportFont name="Arial_Normal" isDefault="true" fontName="Arial" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <reportFont name="Arial_Bold" isDefault="false" fontName="Arial" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <parameter name="ReportTitle" isForPrompting="true" class="java.lang.String"/> <parameter name="NoOfGames" isForPrompting="true" class="java.lang.Integer"/> <field name="belegid" class="java.lang.String"/> <field name="adressid" class="java.lang.String"/> <field name="plz" class="java.lang.String"/> <variable name="adress" class="model.Adressen"></variable> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="30" isSplitAllowed="true" > <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement mode="Transparent" x="0" y="0" width="261" height="30" forecolor="#000000" backcolor="#FFFFFF" key="textField-1" stretchType="NoStretch" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> <font fontName="Arial" pdfFontName="Helvetica" size="24" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{ReportTitle}]]></textFieldExpression> </textField> </band> </title> <pageHeader> <band height="20" isSplitAllowed="true" > <staticText> <reportElement mode="Transparent" x="0" y="4" width="50" height="15" forecolor="#000000" backcolor="#FFFFFF" key="staticText" stretchType="NoStretch" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> <font reportFont="Arial_Bold"/> </textElement> <text><![CDATA[belegid]]></text> </staticText> <staticText> <reportElement mode="Transparent" x="60" y="4" width="30" height="15" forecolor="#000000" backcolor="#FFFFFF" key="staticText" stretchType="NoStretch" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" lineSpacing="Single"> <font reportFont="Arial_Bold"/> </textElement> <text><![CDATA[Adressid]]></text> </staticText> <staticText> <reportElement mode="Transparent" x="60" y="4" width="30" height="15" forecolor="#000000" backcolor="#FFFFFF" key="staticText" stretchType="NoStretch" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" lineSpacing="Single"> <font reportFont="Arial_Bold"/> </textElement> <text><![CDATA[PLZ]]></text> </staticText> </band> </pageHeader> <columnHeader> <band height="0" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="20" isSplitAllowed="true" > <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement mode="Transparent" x="0" y="4" width="50" height="15" forecolor="#000000" backcolor="#FFFFFF" key="textField" stretchType="NoStretch" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single"> <font fontName="Arial" pdfFontName="Helvetica" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{belegid}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement mode="Transparent" x="60" y="4" width="30" height="15" forecolor="#000000" backcolor="#FFFFFF" key="textField" stretchType="NoStretch" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" lineSpacing="Single"> <font fontName="Arial" pdfFontName="Helvetica" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{adressid}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement mode="Transparent" x="60" y="4" width="30" height="15" forecolor="#000000" backcolor="#FFFFFF" key="textField" stretchType="NoStretch" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" lineSpacing="Single"> <font fontName="Arial" pdfFontName="Helvetica" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression><![CDATA[$F{plz}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="0" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="0" isSplitAllowed="true" > </band> </pageFooter> <summary> <band height="0" isSplitAllowed="true" > </band> </summary> </jasperReport> I recive fallowing error : net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : plz at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:127) at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getFieldValue(JRAbstractBeanDataSource.java:100) at net.sf.jasperreports.engine.data.JRBeanCollectionDataSource.getFieldValue(JRBeanCollectionDataSource.java:104) at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:799) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:763) at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1402) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:111) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:888) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:810) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601) at DAO.SimpleHibernateExample.GenerateBeleg(SimpleHibernateExample.java:48) at DAO.SimpleHibernateExample.main(SimpleHibernateExample.java:68) Caused by: java.lang.NoSuchMethodException: Unknown property 'plz' on class 'class model.Beleg' at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1313) at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:762) at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:837) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:426) at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:115) ... 12 more how can i get plz proerty of Adressen?
  2. DNV Srikanth this property is in model.Adressen. This is my method: List belege=null; try{ //begin(); belege= getSession().createQuery("select b from Beleg b join b.adressen a where b.belegid ='AN001913'").list(); //wypelnia parametry HashMap parameters= new HashMap(); parameters.put("titel", Rechnung); //laduje z pliku xml do .jasper JasperDesign design=JRXmlLoader.load(sampleReportFile);i hav join //kompiluje JasperReport report= new JasperCompileManager().compileReport(design); //wypelnia raport uzywajac metody... JasperPrint print= JasperFillManager.fillReport(report, parameters, new JRBeanCollectionDataSource(belege)); // //export do pdf JasperExportManager.exportReportToPdfFile(print, "testRechnung1.pdf"); //commit(); System.out.println("Datei wurde gespeichert" ); }catch(JRException jre){ jre.printStackTrace(); } catch(MappingException me){ me.printStackTrace(); } catch(HibernateException he){ he.printStackTrace(); }
  3. hi all, I have fallowing problem, I try to create report form database but I recive fallowing error: net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : name at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:127) at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getFieldValue(JRAbstractBeanDataSource.java:100) at net.sf.jasperreports.engine.data.JRBeanCollectionDataSource.getFieldValue(JRBeanCollectionDataSource.java:104) at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:799) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:763) at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1402) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:111) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:888) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:810) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601) at DAO.SimpleHibernateExample.GenerateBeleg(SimpleHibernateExample.java:47) at DAO.SimpleHibernateExample.main(SimpleHibernateExample.java:67) Caused by: java.lang.NoSuchMethodException: Unknown property 'name' on class 'class model.Beleg' at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1313) at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:762) at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:837) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:426) at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:115) ... 12 more
  4. i have include poi and itext lib into my bulitpath but it don't help
  5. hi, i have fallowing problem, druing compilation i recive exception : Exception in thread "main" java.lang.NoClassDefFoundError: com/lowagie/text/pdf/FontMapper at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfFile(JasperExportManager.java:121) at DAO.SimpleHibernateExample.GenerateBeleg(SimpleHibernateExample.java:48) at DAO.SimpleHibernateExample.main(SimpleHibernateExample.java:64) please help
  6. Hi, I try to report database values wiht hibernate. but I recive falloving error : net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. Cannot cast from Date to String value = (java.lang.String)(((java.util.Date)field_datum.getValue())); //$JR_EXPR_ID=10$ <----------------------------------------------------------> 2. Cannot cast from Float to String value = (java.lang.String)(((java.lang.Float)field_netto.getValue())); //$JR_EXPR_ID=11$ <-----------------------------------------------------------> 3. Cannot cast from Float to String value = (java.lang.String)(((java.lang.Float)field_mwst.getValue())); //$JR_EXPR_ID=12$ <----------------------------------------------------------> 4. Cannot cast from Integer to String value = (java.lang.String)(((java.lang.Integer)field_rabatt.getValue())); //$JR_EXPR_ID=13$ <--------------------------------------------------------------> 5. Cannot cast from Integer to String value = (java.lang.String)(((java.lang.Integer)field_zbid.getValue())); //$JR_EXPR_ID=14$ <------------------------------------------------------------> 6. Cannot cast from Integer to String value = (java.lang.String)(((java.lang.Integer)field_ausgewaehlt.getValue())); //$JR_EXPR_ID=16$ <-------------------------------------------------------------------> 7. Cannot cast from Float to String value = (java.lang.String)(((java.lang.Float)field_bezahlt.getValue())); //$JR_EXPR_ID=17$ <-------------------------------------------------------------> 8. Cannot cast from Date to String value = (java.lang.String)(((java.util.Date)field_datum.getOldValue())); //$JR_EXPR_ID=10$ <-------------------------------------------------------------> 9. Cannot cast from Float to String value = (java.lang.String)(((java.lang.Float)field_netto.getOldValue())); //$JR_EXPR_ID=11$ <--------------------------------------------------------------> 10. Cannot cast from Float to String value = (java.lang.String)(((java.lang.Float)field_mwst.getOldValue())); //$JR_EXPR_ID=12$ <-------------------------------------------------------------> 11. Cannot cast from Integer to String value = (java.lang.String)(((java.lang.Integer)field_rabatt.getOldValue())); //$JR_EXPR_ID=13$ <-----------------------------------------------------------------> 12. Cannot cast from Integer to String value = (java.lang.String)(((java.lang.Integer)field_zbid.getOldValue())); //$JR_EXPR_ID=14$ <---------------------------------------------------------------> 13. Cannot cast from Integer to String value = (java.lang.String)(((java.lang.Integer)field_ausgewaehlt.getOldValue())); //$JR_EXPR_ID=16$ <----------------------------------------------------------------------> 14. Cannot cast from Float to String value = (java.lang.String)(((java.lang.Float)field_bezahlt.getOldValue())); //$JR_EXPR_ID=17$ <----------------------------------------------------------------> 15. Cannot cast from Date to String value = (java.lang.String)(((java.util.Date)field_datum.getValue())); //$JR_EXPR_ID=10$ <----------------------------------------------------------> 16. Cannot cast from Float to String value = (java.lang.String)(((java.lang.Float)field_netto.getValue())); //$JR_EXPR_ID=11$ <-----------------------------------------------------------> 17. Cannot cast from Float to String value = (java.lang.String)(((java.lang.Float)field_mwst.getValue())); //$JR_EXPR_ID=12$ <----------------------------------------------------------> 18. Cannot cast from Integer to String value = (java.lang.String)(((java.lang.Integer)field_rabatt.getValue())); //$JR_EXPR_ID=13$ <--------------------------------------------------------------> 19. Cannot cast from Integer to String value = (java.lang.String)(((java.lang.Integer)field_zbid.getValue())); //$JR_EXPR_ID=14$ <------------------------------------------------------------> 20. Cannot cast from Integer to String value = (java.lang.String)(((java.lang.Integer)field_ausgewaehlt.getValue())); //$JR_EXPR_ID=16$ <-------------------------------------------------------------------> 21. Cannot cast from Float to String value = (java.lang.String)(((java.lang.Float)field_bezahlt.getValue())); //$JR_EXPR_ID=17$ <-------------------------------------------------------------> what is wrong? Code:<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"><jasperReport name="Handwerk2008BelegReport"> <queryString language="hql"> <![CDATA[from Beleg]]> </queryString> <field name="belegid" class="java.lang.String"/> <field name="adressid" class="java.lang.String"/> <field name="datum" class="java.util.Date"/> <field name="netto" class="java.lang.Float"/> <field name="mwst" class="java.lang.Float"/> <field name="rabatt" class="java.lang.Integer"/> <field name="zbid" class="java.lang.Integer"/> <field name="bemerkung" class="java.lang.String"/> <field name="ausgewaehlt" class="java.lang.Integer"/> <field name="bezahlt" class="java.lang.Float"/> <field name="oztyp" class="java.lang.String"/> <field name="status" class="java.lang.Integer"/> <title> <band height="30"> <staticText> <reportElement width="555" y="0" x="0" height="30"></reportElement> <text> <![CDATA["BelegReport"]]> </text> </staticText> </band> </title> <pageHeader> <band height="30"> <staticText> <reportElement width="100" y="0" x="0" height="30"></reportElement> <text>![CDATA[belegid]]</text> </staticText> <staticText> <reportElement width="100" y="0" x="0" height="30"></reportElement> <text>![CDATA[adressid]]</text> </staticText> <staticText> <reportElement width="100" y="0" x="0" height="30"></reportElement> <text>![CDATA[datum]]</text> </staticText> <staticText> <reportElement width="100" y="0" x="0" height="30"></reportElement> <text>![CDATA[netto]]</text> </staticText> <staticText> <reportElement width="100" y="0" x="0" height="30"></reportElement> <text>![CDATA[mwst]]</text> </staticText> <staticText> <reportElement width="100" y="0" x="0" height="30"></reportElement> <text>![CDATA[rabatt]]</text> </staticText> <staticText> <reportElement width="100" y="0" x="0" height="30"></reportElement> <text>![CDATA[zbid]]</text> </staticText> <staticText> <reportElement width="100" y="0" x="0" height="30"></reportElement> <text>![CDATA[bemerkung]]</text> </staticText> <staticText> <reportElement width="100" y="0" x="0" height="30"></reportElement> <text>![CDATA[ausgewaehlt]]</text> </staticText> <staticText> <reportElement width="100" y="0" x="0" height="30"></reportElement> <text>![CDATA[bezahlt]]</text> </staticText> <staticText> <reportElement width="100" y="0" x="0" height="30"></reportElement> <text>![CDATA[oztyp]]</text> </staticText> <staticText> <reportElement width="100" y="0" x="0" height="30"></reportElement> <text>![CDATA[status]]</text> </staticText> </band> </pageHeader> <detail> <band height="30"> <textField> <reportElement width="100" y="0" x="0" height="20"></reportElement> <textFieldExpression> <![CDATA[$F{belegid}]]> </textFieldExpression> </textField> <textField> <reportElement width="100" y="0" x="0" height="20"></reportElement> <textFieldExpression> <![CDATA[$F{adressid}]]> </textFieldExpression> </textField> <textField> <reportElement width="100" y="0" x="0" height="20"></reportElement> <textFieldExpression> <![CDATA[$F{datum}]]> </textFieldExpression> </textField> <textField> <reportElement width="100" y="0" x="0" height="20"></reportElement> <textFieldExpression> <![CDATA[$F{netto}]]> </textFieldExpression> </textField> <textField> <reportElement width="100" y="0" x="0" height="20"></reportElement> <textFieldExpression> <![CDATA[$F{mwst}]]> </textFieldExpression> </textField> <textField> <reportElement width="100" y="0" x="0" height="20"></reportElement> <textFieldExpression> <![CDATA[$F{rabatt}]]> </textFieldExpression> </textField> <textField> <reportElement width="100" y="0" x="0" height="20"></reportElement> <textFieldExpression> <![CDATA[$F{zbid}]]> </textFieldExpression> </textField> <textField> <reportElement width="100" y="0" x="0" height="20"></reportElement> <textFieldExpression> <![CDATA[$F{bemerkung}]]> </textFieldExpression> </textField> <textField> <reportElement width="100" y="0" x="0" height="20"></reportElement> <textFieldExpression> <![CDATA[$F{ausgewaehlt}]]> </textFieldExpression> </textField> <textField> <reportElement width="100" y="0" x="0" height="20"></reportElement> <textFieldExpression> <![CDATA[$F{bezahlt}]]> </textFieldExpression> </textField> <textField> <reportElement width="100" y="0" x="0" height="20"></reportElement> <textFieldExpression> <![CDATA[$F{oztyp}]]> </textFieldExpression> </textField> </band> </detail></jasperReport>
  7. Hi, I have problem with compiling jrxml-file. druing compiling I recive fallowing error: Compiling report... net.sf.jasperreports.engine.JRException: Error compiling report java source files : E:eclipse3.4GenericsFirstReport_1222419927038_280442.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:192) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:219) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:135) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:94) at jasperReports.FirstRaportCompile.main(FirstRaportCompile.java:11) Caused by: java.io.IOException: Cannot run program "javac": CreateProcess error=2, Das System kann die angegebene Datei nicht finden 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 Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 10 more where is the problem?please help Code:here is my class and jrxml file:package jasperReports;import net.sf.jasperreports.engine.JRException;import net.sf.jasperreports.engine.JasperCompileManager;public class FirstRaportCompile { public static void main(String[] args){ try{ System.out.println("Compiling report..."); JasperCompileManager.compileReportToFile("E:/eclipse3.4/Generics/src/jasperReports/template.jrxml"); System.out.println("Done!"); } catch(JRException e){ e.printStackTrace(); } }}<?xml version="1.0"?><!DOCTYPE jasperReportPUBLIC "-//JasperReports//DTD Report Design//EN""http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"><jasperReport name="FirstReport"><detail><band height="20"><staticText><reportElement x="20" y="0" width="200" height="20"/><text><![CDATA[if you don't see this, it didn't work]]></text></staticText></band></detail></jasperReport>
×
×
  • Create New...