TIBCOSoftware / jasperreports

JasperReports® - Free Java Reporting Library
https://community.jaspersoft.com/downloads/community-edition/
GNU Lesser General Public License v3.0
1.04k stars 401 forks source link

Support groovy closures #242

Closed ari closed 2 years ago

ari commented 2 years ago

When using groovy to evaluate expressions in a report, it would often be very useful to use closures. For example:

$F{aPerson}.invoices.findAll { it.owing > 0 }

This would make it easier to pass data to a subreport with certain filters applied, or to render data without needing a subreport at all.

Unfortunately JasperReports throws an error when attempting to render a closure. What would be required to make this work? We are happy to assist with coding and testing, but some pointers for what the blockers are would be helpful. Are others interested in this?

Note this task from 2015: https://community.jaspersoft.com/jasperreports-library/issues/5241

We'd want to use this feature in our open source student management system. You can see some of the reports here: https://github.com/ishgroup/oncourse/tree/main/server/src/main/resources/reports

ari commented 2 years ago

Thank you. This is brilliant.