TIBCOSoftware / jasperreports

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

runReportToPdf throws Unknown property for java records #396

Closed vukmanovicmilos closed 8 months ago

vukmanovicmilos commented 1 year ago

JasperRunManager.runReportToPdf(jasperReport, params, dataSource); throws java.lang.NoSuchMethodException: Unknown property when datasource is JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(listOfRecords); because trying to call get method on a record, when create custom method in a record that name start with get it works.

teodord commented 1 year ago

You need to provide the entire stack trace of the exception. This is probably caused by a mismatch between a field name in the report dataset and the getter method of the property you try to read from the current record bean in the collection.