How to merge two page.jrxml to one view by using jasper report

Example I have two file one is page1.jrxml and one more page2.jrxml

JRBeanCollectionDataSource beanCollectionDataSource = new JRBeanCollectionDataSource(data); 
Map<String, Object> parameters = new HashMap<>(); 
        
        
        
 JasperReport compileReport = JasperCompileManager.compileReport(new FileInputStream("src/main/resources/templates/page1.jrxml"));
        
        JasperReport compileReport2 = JasperCompileManager
                .compileReport(new FileInputStream("src/main/resources/templates/page2.jrxml"));
        
        
        JasperPrint jasperPrint = JasperFillManager.fillReport(compileReport, parameters, beanCollectionDataSource);

        
        
        byte data[] = JasperExportManager.exportReportToPdf(jasperPrint);
        HttpHeaders headers = new HttpHeaders();
        headers.add("Content-Disposition", "inline; filename=report.pdf"); 
        return ResponseEntity.ok().headers(headers).contentType(MediaType.APPLICATION_PDF).body(data);

I want to merge two of page1 and page2 on one view

Leave a Comment