Jump to content
We've recently updated our Privacy Statement, available here ×

Print Multiple Copies With Small Change (Same Report)


gourav.garg

Recommended Posts

 

Hello Team, 
 
I am using iReport for java Printing . Evertything is working perfectly. 
I have one complex requirment , I need to print same report print multiple times with a report tag name change. 
 
Everythign is dynamic and working perfectly.
 
Please suggest what I need to do .
 
For references I am enclosing a report . Please check out
 
E.g I need to write Office Copy instead of Original Copy in Second Copy. I want to Show both Copies same in same time. 
 
Regards, 
Gourav Garg
 
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • 6 months later...

Make multiple jrxml with different heading.just change copy1,copy2 in each report.And add each report to one list and generate single pdf report.Problem solved.

My code:

JasperDesign jd1=JRXmlLoader.load(request.getRealPath("/jasper") + "/DispatchNote.jrxml");
        JasperReport jreport1 = JasperCompileManager.compileReport(jd1);
           JasperPrint jprint1 = JasperFillManager.fillReport(jreport1, parameters11, new dbConnection().getConnection());
           
           JasperDesign jd2=JRXmlLoader.load(request.getRealPath("/jasper") + "/DispatchNote.jrxml");
           JasperReport jreport2 = JasperCompileManager.compileReport(jd2);
           JasperPrint jprint2 = JasperFillManager.fillReport(jreport2, parameters1, new dbConnection().getConnection());
 
jprintlist.add(jprint1);
            jprintlist.add(jprint2);
JRPdfExporter pdfExporter=new JRPdfExporter();
           pdfExporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST,jprintlist);
           FileOutputStream output = new FileOutputStream(new File(request.getRealPath("/jasper") + "/silent_print"+".pdf"));
           pdfExporter.setParameter(JRPdfExporterParameter.OUTPUT_STREAM, output);
           pdfExporter.exportReport(); 

 

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...