luke2000 Posted November 6, 2018 Share Posted November 6, 2018 Dear Community,i have to implement reports in my application, therefore the app provides a set of id's which shall be used in the report.In the docs i found how to implement a DataSource, so passing the first entries to the report should be fine.jasperreports-6.7.0demosamplesdatasourcesrcThe next step would be to provide related Objects. Within the Report, I need to retrieve related objects from my DataSource.NOTE: related objects might be direct attributes from the Object provided by the DataSource or via dedicated methods.// this method returns a direct attribute (can be another object/entity)Object getFieldValue(JRField field)// this method returns related Multimedia for the Object with id Object getRelatedMultimedia(Object id) [/code]Therefore the DataSource will implement further methods to gain those Objects.Unfortunately i did not find a sample how to do this. I am willing to work out an simple example, if someone can lead me through how to do so.EDIT: if possible its also fine to specify a query to gain the related data - then no DataSource for the subreport would be required - just needs to pass the id of the Object for the subreport and its Table name / Class nameThanks in Advance! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now