Jump to content

Recommended Posts

Posted

hey,  i am filling my report using a parameter(  class  =   net.sf.jasperreports.engine.data.JRBeanCollectionDataSource)
 

the object what i am sending has 2 atributes:   class object {  private int code, private float value ...}

then in my table in jasper report , i used the dataset with 2 fields(code and value),

i changed the class of this fields ( by defect was String)  to java.lang.Integer and java.lang.Float

but the report does not work  ( i used this method when i have objects with String atributes and it works very fine )

 

Any idea?? Thanks

 

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

May be it's because int != Integer and float != Float. Just fix your error and your report should work. Can't say anything further because you haven't proviced any information on how your report does not work nor any error message.

Posted

the error is:

net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Error retrieving field value from bean: .
    at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:872)
    at net.sf.jasperreports.components.table.fill.FillTableSubreport.prepareSubreport(FillTableSubreport.java:166)
    at net.sf.jasperreports.components.table.fill.FillTable.prepare(FillTable.java:417)
    at net.sf.jasperreports.engine.fill.JRFillComponentElement.prepare(JRFillComponentElement.java:150)
    at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:330)
    at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:382)
    at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:357)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2031)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:755)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:262)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:122)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:551)
    at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:411)
    at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:122)
    at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:667)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:983)

Caused by: java.lang.NoSuchMethodException: Unknown property ' ' on class 'class MyObject'
    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:112)
    ... 14 more

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...