jesus_jfri Posted November 24, 2015 Posted November 24, 2015 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.Floatbut the report does not work ( i used this method when i have objects with String atributes and it works very fine ) Any idea?? Thanks
hozawa Posted November 25, 2015 Posted November 25, 2015 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.
jesus_jfri Posted November 25, 2015 Author Posted November 25, 2015 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
hozawa Posted November 25, 2015 Posted November 25, 2015 There seems to be something wrong with you code but as an easy answer, why not just use String and convert it to Integer and Float is Expression.
Solution jesus_jfri Posted November 26, 2015 Author Solution Posted November 26, 2015 i solved that, i had no problem, i did not know why my report did not work but i solve deleting and making again the report ( jrxml )
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now