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

maci.sajko

Members
  • Posts

    2
  • Joined

  • Last visited

maci.sajko's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare

Recent Badges

0

Reputation

  1. @RequestMapping(value="/getSviClanoviReport.pdf", method=RequestMethod.GET) public void showReport(HttpServletResponse response) throws Exception{ JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(cr.findAllByOrderByDatumUpisa()); InputStream inputStream = this.getClass().getResourceAsStream("/jasperreports/SviClanoviReport.jrxml"); JasperReport jasperReport = JasperCompileManager.compileReport(inputStream); Map<String, Object> params = new HashMap<String, Object>(); params.put("imeBiblioteke", "Biblioteka DMI"); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params, dataSource); inputStream.close(); response.setContentType("application/x-download"); response.addHeader("Content-disposition", "attachment; filename=SviClanovi.pdf"); OutputStream out = response.getOutputStream(); JasperExportManager.exportReportToPdfStream(jasperPrint,out); } Another One @RequestMapping(value="/ClanoviUPeriodu.pdf", method=RequestMethod.GET) public void showReport1(HttpServletResponse response, Date datumOd, Date datumDo) throws Exception{ JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(cr.getClanoviUPeriodu(datumOd, datumDo)); InputStream inputStream = this.getClass().getResourceAsStream("/jasperreports/ClanoviUPeriodu.jrxml"); JasperReport jasperReport = JasperCompileManager.compileReport(inputStream); Map<String, Object> params = new HashMap<String, Object>(); params.put("datumOd", datumOd); params.put("datumDo", datumDo); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params, dataSource); inputStream.close(); response.setContentType("application/x-download"); response.addHeader("Content-disposition", "attachment; filename=ClanoviUPeriodu.pdf"); OutputStream out = response.getOutputStream(); JasperExportManager.exportReportToPdfStream(jasperPrint,out); }
  2. @RequestMapping(value="/getSviClanoviReport.pdf", method=RequestMethod.GET) public void showReport(HttpServletResponse response) throws Exception{ JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(cr.findAllByOrderByDatumUpisa()); InputStream inputStream = this.getClass().getResourceAsStream("/jasperreports/SviClanoviReport.jrxml"); JasperReport jasperReport = JasperCompileManager.compileReport(inputStream); Map<String, Object> params = new HashMap<String, Object>(); params.put("imeBiblioteke", "Biblioteka DMI"); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params, dataSource); inputStream.close(); response.setContentType("application/x-download"); response.addHeader("Content-disposition", "attachment; filename=SviClanovi.pdf"); OutputStream out = response.getOutputStream(); JasperExportManager.exportReportToPdfStream(jasperPrint,out); } Another One @RequestMapping(value="/ClanoviUPeriodu.pdf", method=RequestMethod.GET) public void showReport1(HttpServletResponse response, Date datumOd, Date datumDo) throws Exception{ JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(cr.getClanoviUPeriodu(datumOd, datumDo)); InputStream inputStream = this.getClass().getResourceAsStream("/jasperreports/ClanoviUPeriodu.jrxml"); JasperReport jasperReport = JasperCompileManager.compileReport(inputStream); Map<String, Object> params = new HashMap<String, Object>(); params.put("datumOd", datumOd); params.put("datumDo", datumDo); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params, dataSource); inputStream.close(); response.setContentType("application/x-download"); response.addHeader("Content-disposition", "attachment; filename=ClanoviUPeriodu.pdf"); OutputStream out = response.getOutputStream(); JasperExportManager.exportReportToPdfStream(jasperPrint,out); }
×
×
  • Create New...