Jump to content

ogidantunde

Members
  • Posts

    2
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Everything posted by ogidantunde

  1. Hello, i'm quite new to jasper reports. and i'm trying to embed it in my application.However i guess thejrxml file was successfully parsed. I'm using a custom table model as my data source but i recieve the following compile error Code:net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=0$ <---------------> 2. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=1$ <---------------> 3. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=2$ <---------------> 4. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(0));//$JR_EXPR_ID=3$ <---------------> 5. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=4$ <---------------> 6. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(0));//$JR_EXPR_ID=5$ <---------------> 7. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=6$ <---------------> 8. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(0));//$JR_EXPR_ID=7$ <---------------> 9. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=0$ <---------------> 10. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=1$ <---------------> 11. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=2$ <---------------> 12. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(0));//$JR_EXPR_ID=3$ <---------------> 13. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=4$ <---------------> 14. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(0));//$JR_EXPR_ID=5$ <---------------> 15. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=6$ <---------------> 16. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(0));//$JR_EXPR_ID=7$ <---------------> 17. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=0$ <---------------> 18. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=1$ <---------------> 19. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=2$ <---------------> 20. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(0));//$JR_EXPR_ID=3$ <---------------> 21. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=4$ <---------------> 22. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(0));//$JR_EXPR_ID=5$ <---------------> 23. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=6$ <---------------> 24. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(0));//$JR_EXPR_ID=7$ <---------------> 24 errors at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:193) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(Jasper CompileManager.java:219) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:152) The jrxml listing goes thus Code:[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="SalesInvoice" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" isFloatColumnFooter="true" > <style name="Arial_Normal" isDefault="true" fontName="Arial" fontSize="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <style name="Arial_Bold" isDefault="false" fontName="Arial" fontSize="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <style name="Arial_Italic" isDefault="false" fontName="Arial" fontSize="8" isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <style name="Comic_Normal" isDefault="false" fontName="Comic Sans MS" fontSize="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="COMIC.TTF" pdfEncoding="Identity-H" isPdfEmbedded="true"/> <style name="Comic_Bold" isDefault="false" fontName="Comic Sans MS" fontSize="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="COMICBD.TTF" pdfEncoding="Identity-H" isPdfEmbedded="true"/> <parameter name="CompanyName" class="java.lang.String"> </parameter> <parameter name="CompanyAddress" class="java.lang.String"> </parameter> <parameter name="CompanyLogo" class="java.awt.Image"> </parameter> <parameter name="SalesId" class="java.lang.String"> </parameter> <parameter name="CustomerId" class="java.lang.String"> </parameter> <parameter name="CustomerName" class="java.lang.String"> </parameter> <field name="COLUMN_0" class="java.lang.String"> </field> <field name="COLUMN_1" class="java.lang.String"> </field> <field name="COLUMN_2" class="java.lang.String"> </field> <field name="COLUMN_3" class="java.lang.String"> </field> <field name="COLUMN_4" class="java.lang.String"> </field> <field name="COLUMN_5" class="java.lang.String"> </field> <field name="COLUMN_6" class="java.lang.String"> </field> <title> <band height="100"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="375" height="35" style="Comic_Bold"/> <textElement textAlignment="Center"> <font size="22"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{CompanyName}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement x="0" y="40" width="400" height="20" style="Comic_Bold"/> <textElement textAlignment="Center"> <font size="10"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{CompanyAddress}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="60" width="375" height="25" style="Arial_Bold"/> <textElement textAlignment="Center"> <font size="12"/> </textElement> <text><![CDATA[sales Invoice And Reciept]]></text> </staticText> </band> </title> <columnHeader> <band height="11"> <staticText> <reportElement mode="Opaque" x="0" y="0" width="50" height="11" forecolor="#ffffff" backcolor="#333333" style="Arial_Bold"/> <textElement textAlignment="Center"/> <text><![CDATA[Product]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="50" y="0" width="50" height="11" forecolor="#ffffff" backcolor="#333333" style="Arial_Bold"/> <textElement textAlignment="Center"/> <text><![CDATA[unit Price]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="100" y="0" width="50" height="11" forecolor="#ffffff" backcolor="#333333" style="Arial_Bold"/> <text><![CDATA[Quantity]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="150" y="0" width="50" height="11" forecolor="#ffffff" backcolor="#333333" style="Arial_Bold"/> <textElement textAlignment="Right"/> <text><![CDATA[Amount]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="200" y="0" width="50" height="11" forecolor="#ffffff" backcolor="#333333" style="Arial_Bold"/> <textElement textAlignment="Center"/> <text><![CDATA[sales Price]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="250" y="0" width="50" height="11" forecolor="#ffffff" backcolor="#333333" style="Arial_Bold"/> <textElement textAlignment="Center"/> <text><![CDATA[Discount]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="300" y="0" width="50" height="11" forecolor="#ffffff" backcolor="#333333" style="Arial_Bold"/> <text><![CDATA[Amt Payable]]></text> </staticText> </band> </columnHeader> <detail> <band height="13"> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="0" y="0" width="50" height="11"/> <textElement textAlignment="Left"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_0}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="50" y="0" width="50" height="11"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_1}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="100" y="0" width="50" height="11"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_2}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="150" y="0" width="50" height="11"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_3}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="200" y="0" width="50" height="11"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_4}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="250" y="0" width="50" height="11"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_5}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="300" y="0" width="50" height="11"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_6}]]></textFieldExpression> </textField> <line> <reportElement positionType="Float" x="0" y="12" width="270" height="1" forecolor="#808080"/> <graphicElement> <pen lineWidth="0.5"/> </graphicElement> </line> </band> </detail> </jasperReport> Please can someone just help me out its very urgent . I'd like to the advantages of jasper reports in my latest project or i might be forced to find another way. Thanks alot. I just can't wait.
  2. Hello everyone. I'm very new to jasper reports. I'm trying to use jasper reports in my application. but on running it i get the following error message net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=0$ <---------------> 2. java.lang.Integer cannot be resolved or is not a type value = (java.lang.Integer)(new Integer(1));//$JR_EXPR_ID=1$ <---------------> What i'm my datasource is a table model which looks like this Code: javax.swing.table.DefaultTableModel aModel = new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "Product", "Unit Price","Quantity", "Amount", "Sales Price","Discount","Amount Payable" } ) { Class[] types = new Class [] { java.lang.Object.class, java.lang.Double.class, java.lang.Double.class, java.lang.Double.class , java.lang.Double.class, java.lang.Double.class, java.lang.Double.class }; boolean[] canEdit = new boolean [] { false, false, false, false, false, false, false }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } public Object getValueAt(int row, int column) { Vector rowVector = (Vector)dataVector.elementAt(row); try{ if(column==1) return utils.NumberFormatter.formatNumericIntegerInput(utils.NumberFormatter.convertFormattedInputToInteger(rowVector.elementAt(column).toString())); else if(column == 3 ||column == 4 ||column == 5 ||column == 6 ) return utils.NumberFormatter.formatNumericDoubleInput(utils.NumberFormatter.convertFormattedInputToDouble(rowVector.elementAt(column).toString())); else if(column == 2 ) return utils.NumberFormatter.convertFormattedInputToInteger(rowVector.elementAt(column).toString().trim()); else return rowVector.elementAt(column); } catch(Exception e){ return rowVector.elementAt(column); } } }; the jrxml file looks like this Code:[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="SalesInvoice" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" isFloatColumnFooter="true" > <style name="Arial_Normal" isDefault="true" fontName="Arial" fontSize="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <style name="Arial_Bold" isDefault="false" fontName="Arial" fontSize="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <style name="Arial_Italic" isDefault="false" fontName="Arial" fontSize="8" isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <style name="Comic_Normal" isDefault="false" fontName="Comic Sans MS" fontSize="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="COMIC.TTF" pdfEncoding="Identity-H" isPdfEmbedded="true"/> <style name="Comic_Bold" isDefault="false" fontName="Comic Sans MS" fontSize="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="COMICBD.TTF" pdfEncoding="Identity-H" isPdfEmbedded="true"/> <parameter name="CompanyName" class="java.lang.String"> </parameter> <parameter name="CompanyAddress" class="java.lang.String"> </parameter> <parameter name="CompanyLogo" class="java.awt.Image"> </parameter> <parameter name="SalesId" class="java.lang.String"> </parameter> <parameter name="CustomerId" class="java.lang.String"> </parameter> <parameter name="CustomerName" class="java.lang.String"> </parameter> <field name="COLUMN_0" class="java.lang.String"> </field> <field name="COLUMN_1" class="java.lang.String"> </field> <field name="COLUMN_2" class="java.lang.String"> </field> <field name="COLUMN_3" class="java.lang.String"> </field> <field name="COLUMN_4" class="java.lang.String"> </field> <field name="COLUMN_5" class="java.lang.String"> </field> <field name="COLUMN_6" class="java.lang.String"> </field> <title> <band height="100"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="375" height="35" style="Comic_Bold"/> <textElement textAlignment="Center"> <font size="22"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{CompanyName}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement x="0" y="40" width="400" height="20" style="Comic_Bold"/> <textElement textAlignment="Center"> <font size="10"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{CompanyAddress}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="60" width="375" height="25" style="Arial_Bold"/> <textElement textAlignment="Center"> <font size="12"/> </textElement> <text><![CDATA[sales Invoice And Reciept]]></text> </staticText> </band> </title> <columnHeader> <band height="11"> <staticText> <reportElement mode="Opaque" x="0" y="0" width="50" height="11" forecolor="#ffffff" backcolor="#333333" style="Arial_Bold"/> <textElement textAlignment="Center"/> <text><![CDATA[Product]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="50" y="0" width="50" height="11" forecolor="#ffffff" backcolor="#333333" style="Arial_Bold"/> <textElement textAlignment="Center"/> <text><![CDATA[unit Price]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="100" y="0" width="50" height="11" forecolor="#ffffff" backcolor="#333333" style="Arial_Bold"/> <text><![CDATA[Quantity]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="150" y="0" width="50" height="11" forecolor="#ffffff" backcolor="#333333" style="Arial_Bold"/> <textElement textAlignment="Right"/> <text><![CDATA[Amount]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="200" y="0" width="50" height="11" forecolor="#ffffff" backcolor="#333333" style="Arial_Bold"/> <textElement textAlignment="Center"/> <text><![CDATA[sales Price]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="250" y="0" width="50" height="11" forecolor="#ffffff" backcolor="#333333" style="Arial_Bold"/> <textElement textAlignment="Center"/> <text><![CDATA[Discount]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="300" y="0" width="50" height="11" forecolor="#ffffff" backcolor="#333333" style="Arial_Bold"/> <text><![CDATA[Amt Payable]]></text> </staticText> </band> </columnHeader> <detail> <band height="13"> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="0" y="0" width="50" height="11"/> <textElement textAlignment="Left"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_0}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="50" y="0" width="50" height="11"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_1}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="100" y="0" width="50" height="11"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_2}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="150" y="0" width="50" height="11"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_3}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="200" y="0" width="50" height="11"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_4}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="250" y="0" width="50" height="11"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_5}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="300" y="0" width="50" height="11"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA[$F{COLUMN_6}]]></textFieldExpression> </textField> <line> <reportElement positionType="Float" x="0" y="12" width="270" height="1" forecolor="#808080"/> <graphicElement> <pen lineWidth="0.5"/> </graphicElement> </line> </band> </detail> </jasperReport> I've been trough a lot a posts and tried various teschniques but it still wont work. Can any pls help me out on this. Its very urgent.
×
×
  • Create New...