public static List < Report > getSubreports ( Report report ) { List < Report > subreports = new ArrayList < Report > ( ) ; List < Band > bands = report . getLayout ( ) . getDocumentBands ( ) ; for ( Band band : bands ) { for ( int i = 0 , rows = band . getRowCount ( ) ; i < rows ; i ++ ) { List < BandElement > list = band . getRow ( i ) ; for ( int j = 0 , size = list . size ( ) ; j < size ; j ++ ) { BandElement be = list . get ( j ) ; if ( be instanceof ReportBandElement ) { subreports . add ( ( ( ReportBandElement ) be ) . getReport ( ) ) ; } } } } return subreports ; }
Get subreports for a report