Hi Oscar, thanks alot for the code, will try it :) On Mon, May 11, 2009 at 6:59 PM, wild_oscar <mig...@almeida.at> wrote:
> > Hi, > > I don't think the plugin was available when I used Jasper with an > application. I simply passed some Collections into the report and created > them. You can have a look at the code: > > Movement mov = movementManger.findById(movementId); > List<Movement> list = new ArrayList<Movement>(); > SortedSet<ProductProperties> storageProps = > preparePropertiesList(StringUtilities.TYPESTORAGE, mov); > SortedSet<ProductProperties> riskProps = > preparePropertiesList(StringUtilities.TYPEPOTENTIALRISKS, mov); > list.add(mov); > JRBeanCollectionDataSource ds = new > JRBeanCollectionDataSource(list); > Map<String, Object> parameters = new HashMap<String, > Object>(); > List<Trial> trialList = new ArrayList<Trial>(); > if(trialidPdf != 0) > { > Trial trial = trialManager.findById(trialidPdf); > trialList.add(trial); > parameters.put("TRIAL CODE", trial.getCode()); > > } > > parameters.put("SUBREPORT_DIR", > StringUtilities.JASPER_PATH); > parameters.put("STORAGE PROPERTIES", storageProps); > parameters.put("RISK PROPERTIES", riskProps); > parameters.put("TRIAL", trialList); > parameters.put("TYPE STORAGE", StringUtilities.TYPESTORAGE); > parameters.put("TYPE RISK", > StringUtilities.TYPEPOTENTIALRISKS); > parameters.put("COPY NUMBER", copyNumber); > byte[] outputFile; > > try { > JasperReport jasperReport = > (JasperReport)JRLoader.loadObject(StringUtilities.JASPER_PATH + > StringUtilities.JASPER_SHIPMENTFORM); > JasperPrint jasperPrint = > JasperFillManager.fillReport(jasperReport, > parameters,ds); > outputFile = > JasperExportManager.exportReportToPdf(jasperPrint); > inputStream = new ByteArrayInputStream(outputFile); > > } catch (JRException e) { > log.error(e.toString()); > e.printStackTrace(); > } > > Yanto wrote: > > > > Hi, > > > > What's the most common way people used to call the JasperReport when used > > Struts 2 framework ? > > > > I've read Bruce Phillips Blog, > > > http://www.brucephillips.name/blog/index.cfm/2008/7/12/Using-The-JasperReports-Struts2-Plugin-A-Main-Report-And-A-Subreport > > > > just want to know, whether most of people use the same method as bruce or > > there is other most common way. > > > > Thanks & Regards > > Yanto > > > > > > -- > View this message in context: > http://www.nabble.com/Integrate-JasperReports-into-a-Struts2-web-application-tp23479814p23481107.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >