Jump to content
  • Fields set to type java.util.Collection search for field description instead of field name

    CategoryBug report

    Fields created of type java.util.Collection in iReport and assigned to subreports produce a strange behaviour. During fillreport with JasperFillManager the class JRAbstractBeanDataSource returns the field description rather than the field name. Hence if the field description is set to the name of the field the report generation is successful, else it fails. Please see the stack trace under additional information and file attached.


    iReport version is:

    Product Version: Jaspersoft iReport Designer 4.1.1

    Java: 1.6.0_23; Java HotSpot Client VM 19.0-b09

    System: Windows 7 Version 6.1 läuft auf x86; Cp1252; de_DE (ireport)

    Benutzerverzeichnis: C:\Users\schlicht\.ireport\4.1.1


    Jar file used is:




    Thanks for your help.



    User Feedback

    Recommended Comments

    The category for this bug should not be "[iReport] Bugs iReport (up to 3.0.x)". The bug is reported on iReport 4.1. This is an old version... but not as old as 3.0.


    I have re-assigned the bug to a member of the JasperReports team, since I have never used a Java Bean data source before.


    I speculate the the problem is simple. The description reads this:

    (new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{field}))


    But the report data source is a Java Bean containing a Collection field, not a Java Bean containing a Java Bean field. Therefore the subreport data source expression should instead be this:

    new net.sf.jasperreports.engine.data.JRMapCollectionDataSource($F{field})

    Link to comment
    Share on other sites

    The report data source used is a Collection of Java PoJo Objects and are indeed Java Beans associated with tables in a DB. That the PoJo has a property of type list/collection containing PoJos, is in this case a coincidence that caused this bug to appear.

    The PoJo's property is a list/collection of Java Beans to be precise. The PoJos are being generated by hibernate.


    But as I can see inside the method "JRAbstractBeanDataSource.getBeanProperty" that it is returning the description and not the name, for me the problem is straightforward.

    Link to comment
    Share on other sites

    I have attempted again--still unsuccessfully--to fully understand the issue. But that's OK. I'm not a developer. BUT... the bug is still incorrectly defined as an iReport 3.0 or earlier issue. Actually... it sounds to me like a JR issue rather than an iReport issue.


    I have attempted again--successfully this time--to assign the bug to someone on the iReport team.



    Link to comment
    Share on other sites

  • Create New...