ericwilk / jasperoo

Automatically exported from code.google.com/p/jasperoo
0 stars 0 forks source link

enum type for jasper roo #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create enum class 
2. Create another class, that refer to enum class
3. Try create export from table view to pdf/excel

What is the expected output? What do you see instead?
Expected output is that pdf/excel report is created.
And actual result is:
java.lang.NoSuchMethodException: Unknown property 'CountryName' on class 'class 
domain.User'
    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)
    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:822)

What version of the product are you using? On what operating system?
Spring roo 1.1.2

Please provide any additional information below.

Original issue reported on code.google.com by TalaII...@gmail.com on 4 Apr 2011 at 2:33

GoogleCodeExporter commented 9 years ago
This probably stems from the jasper reports engine not knowing how to convert 
that enum for presentation in the report.

I will investigate further.

Original comment by wa...@digitalface.ca on 4 May 2011 at 3:51

GoogleCodeExporter commented 9 years ago

Original comment by wa...@digitalface.ca on 4 May 2011 at 3:54

GoogleCodeExporter commented 9 years ago
Hi 
i already find solution of this problem.
You must create finder to class which implemeted enum class and then change 
line in .jrxml file to something similar

<![CDATA[User.findUsersByUsername($F{username}).getSingleResult().getCountryName
().toString()]]>

Original comment by TalaII...@gmail.com on 10 May 2011 at 7:48