Thing is you should not write this code in java.Open your ireport.In main report you might have added 6 reports.Right click that subreport.In print when expression of sub report just copy the following. new Boolean($V{REPORT_COUNT}.intValue==1).That means sub report will print only one time.if you want only one time compare to 1.if youw want two times compare to two.Thats it your problem over.