java - Generate N reports on the same PDF according to a value -


i'm trying generate report using jasperreport 1 pdf multiple pages difference order number of each one.

here code:

int keygenerated = daoordenretiro.crearordenretiro(ord, temperado, sessionusuario);         conexion con = new conexion();         try {             hashmap<string, object> parametros = new hashmap<string, object>();             facescontext context = facescontext.getcurrentinstance();             servletcontext servlecontext = (servletcontext) context.getexternalcontext().getcontext();             parametros.put("rutaimagen", servlecontext.getrealpath("/reportes/"));             parametros.put("cod_ordenretiro", keygenerated);             string temperatura = temperado == true ? "reportefreezer.jasper" : "reportenofreezer.jasper";             string jrxmlpath = temperatura.equals("reportefreezer.jasper") ? "reportefreezer.jrxml" : "reportenofreezer.jrxml";             inputstream = new fileinputstream(servlecontext.getrealpath("/reportes/") + jrxmlpath);             string nom_archivo = "orden_de_retiro.pdf";             string exportdir = system.getproperty("catalina.base") + "/ordenesretiro/";             string exportpath = exportdir + nom_archivo;             jasperdesign design = jrxmlloader.load(is);             jasperreport jasperreport = jaspercompilemanager.compilereport(design);             jasperprint jasperprint = jasperfillmanager.fillreport(jasperreport, parametros, con.getconnection());             jasperexportmanager.exportreporttopdffile(jasperprint, exportpath);          } catch (exception e) {             system.err.println(e);         } } 

this code generate pdf , stores on direction on server. need generate on same pdf multiple reports according int number (this value going inserted user).

the keygenerated value serial cod of insert query set order number on report.

the report same, difference going order number value. suggestion?


Comments