Link to bean
To declare a field that refers to the bean itself, and not one of its properties, specify a field description for the _THIS .
<field name="myJavaBean" class="com.your.package.MyJavaBean"> <fieldDescription>_THIS</fieldDescription> </field>
You can pass this as a subtitle parameter, like any other field.
<subreportParameter name="myJavaBean"> <subreportParameterExpression> <![CDATA[$F{myJavaBean}]]> </subreportParameterExpression> </subreportParameter>
Methods in a bean can be called in the usual way, that is: $F{myJavaBean}.someMethod()
Link to one item in the collection
Depending on what you are doing here, this can be tricky. If you want to see only the details for an individual element, set printWhenExpression on the strip the key of the desired element. However, if you want some report elements to refer to one object in the collection, and the rest of the group refer to another, you would probably be better off if you nested another subreport in a range of details.
source share