I would like to pass as a parameter to my .jrxml an arbitrary object of my domain, e.g a Person.
InputStream reportFile = MyPage.this.getClass().getResource
Yes, you can pass any Java object, but you should make sure to import that object in the JRXML.
Inside the jasperReport tag. You can use the tag import
, like:
However, you can use JRBeanCollectionDataSource
and populate the report with a list of your object, without needing to store arbitrary objects in the params map.
Check this tutorial for more info on Jasper Reports Bean Collection Data Source