mainreport = JasperCompileManager.compileReport(//path of mainreport.jrxml); subreport = JasperCompileManager.compileReport(//path of subreport.jrxml); Map params = new HashMap(); params.put("SUB_REPORT", subreport); params.put("DATA_SOURCE", empService.getEmpProject()); jprint1 = JasperFillManager.fillReport(mainreport,params,new JRBeanCollectionDataSource(empService.getEmpBean())); JasperExportManager.exportReportToPdfFile(jprint1, "C://Test.pdf");