thiagoalgo Posted February 19, 2008 Share Posted February 19, 2008 The JasperReport accepts subreport within another subreport? Link to comment Share on other sites More sharing options...
slaisne Posted February 19, 2008 Share Posted February 19, 2008 of course, and it's work fine Link to comment Share on other sites More sharing options...
thiagoalgo Posted February 19, 2008 Author Share Posted February 19, 2008 How is the field of a bean of a subreport to another subreport? When you create a field containing a JRDataSource to another subreport happens a ClassCastException because the jasperreport tries to convert String. Link to comment Share on other sites More sharing options...
slaisne Posted February 19, 2008 Share Posted February 19, 2008 I don't understand very well what you tried,because the objective is to call a subreportin the same maner like the main report.If respect this, you can chain subreports.A field is not a JRDataSource. Link to comment Share on other sites More sharing options...
thiagoalgo Posted February 19, 2008 Author Share Posted February 19, 2008 I will try to illustrate: I have a report of countries. For each country I have a sub-report of states. Within the sub-report of states I would like to have a sub-report of cities. This is possible? Working with collections of java beans or JRDataSource, as I move the towns of under-report of the sub-states to report for cities? Thanks, Link to comment Share on other sites More sharing options...
C-Box Posted February 19, 2008 Share Posted February 19, 2008 Just use a BeanCollectionDataSource from your current state to call the city subReport with all the Cities that are within that state. So I guess something like "new JRBeanCollectionDataSource($F{State}.getCities())" should work (not sure, code just from mind) Just for example - don't know your beanstructure. hthC-Box 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