In main datasource I have a field "List someDto". And I need to add this field to subreport datasource. Maybe I can use some expression, that will return JRDataSource type?
report.addDetail(subreport(report()
.addDetail(text(field("text", String.class)))
.addDetail(image(fieldExpression("image")))
.setDataSource(----*here i need to add field from main datasource*----)
Omg, I just use subDatasourceBeanCollection and replace .setDataSource from the report().setDataSource to subreport(...).setDataSource():
report.addDetail(subreport(report()
.addDetail(text(field("text", String.class)))
.addDetail(image(fieldExpression("image"))))
.setDataSource(subDatasourceBeanCollection("*here my field from main datasource")));